在./node_modules/typescript-string-operations/dist/index.js中出现错误

zbq4xfa0  于 2022-11-26  发布在  TypeScript
关注(0)|答案(1)|浏览(150)

bounty将在5天后过期。回答此问题可获得+50声望奖励。Igor Paiva希望吸引更多人关注此问题。

我在npm启动后收到此错误
代码未编译,它在node_module上抛出错误。/node_modules/typescript字符串操作/dist/index. js 1:607
模块剖析失败:意外的标记(1:607)您可能需要适当的加载程序来处理此文件类型。
这是我的package.json

{
  "name": "",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/build-angular": "^0.13.0",
    "@angular/animations": "^7.0.3",
    "@angular/cdk": "^7.0.3",
    "@angular/common": "~7.0.0",
    "@angular/compiler": "~7.0.0",
    "@angular/core": "~7.0.0",
    "@angular/forms": "~7.0.0",
    "@angular/http": "~7.0.0",
    "@angular/material": "^7.0.3",
    "@angular/platform-browser": "~7.0.0",
    "@angular/platform-browser-dynamic": "~7.0.0",
    "@angular/router": "~7.0.0",
    "angular2-hotkeys": "^2.1.4",
    "angular2-uuid": "^1.1.1",
    "core-js": "^2.5.4",
    "file-saver": "^2.0.1",
    "hammerjs": "^2.0.8",
    "html2canvas": "^1.0.0-alpha.12",
    "jspdf": "^1.5.2",
    "mat-progress-buttons": "^7.1.2",
    "moment": "^2.29.1",
    "ng2-ckeditor": "^1.1.9",
    "ngx-sortable": "^1.0.3",
    "rxjs": "^6.3.3",
    "typescript-string-operations": "^1.5.0",
    "xlsx": "^0.14.5",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "7.0.3",
    "@angular/compiler-cli": "7.0.1",
    "@angular/language-service": "7.0.1",
    "@compodoc/compodoc": "1.1.5",
    "@types/jasmine": "2.8.9",
    "@types/jasminewd2": "2.0.5",
    "@types/node": "8.10.30",
    "codelyzer": "4.5.0",
    "husky": "1.1.2",
    "jasmine-core": "3.3.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "3.1.1",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage-istanbul-reporter": "2.0.4",
    "karma-jasmine": "1.1.2",
    "karma-jasmine-html-reporter": "1.4.0",
    "lint-staged": "7.3.0",
    "ng-packagr": "4.4.0",
    "prettier": "1.14.3",
    "protractor": "5.4.1",
    "stylelint": "9.6.0",
    "stylelint-order": "1.0.0",
    "stylelint-scss": "3.3.2",
    "ts-node": "7.0.1",
    "tsickle": "0.33.1",
    "tslib": "1.9.3",
    "tslint": "5.11.0",
    "typescript": "^3.1.1"
  }
}

这是我的tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "skipLibCheck": true,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}
e0bqpujr

e0bqpujr1#

我已经找到了这个地方,尝试一次。安装博览会webpack配置依赖

npm i -D @expo/webpack-config

在项目的根文件夹中创建webpack.config.js,并添加下面的代码片段

const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function(env, argv) {
    const config = await createExpoWebpackConfigAsync({
        ...env,
        babel: {
            dangerouslyAddModulePathsToTranspile: ['@ui-kitten/components']
        }
    }, argv);
    return config;
};

相关问题