我正在为angular迁移,这是先前发布的package.json:
"name": "test123",
"version": "0.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"@angular/animations": "^4.4.6",
"@angular/cli": "1.4.1",
"@angular/common": "^4.4.6",
"@angular/compiler": "^4.4.6",
"@angular/compiler-cli": "^4.4.6",
"@angular/core": "^4.4.6",
"@angular/forms": "^4.4.6",
"@angular/http": "^4.4.6",
"@angular/language-service": "^4.4.6",
"@angular/platform-browser": "^4.4.6",
"@angular/platform-browser-dynamic": "^4.4.6",
"@angular/platform-server": "^4.4.6",
"@angular/router": "^4.4.6",
"@jaspero/ng2-confirmations": "^0.3.3",
"@types/google-maps": "^3.2.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^6.0.90",
"angular-confirmation-popover": "^3.2.0",
"angular-font-awesome": "^2.3.7",
"angular2-datatable-pagination": "git+https://github.com/CasperTech/angular2-datatable-pagination.git",
"angular2-json2csv": "^1.1.2",
"angular2-lightbox": "^1.2.1",
"bootstrap": "^3.3.7",
"chart.js": "^2.7.1",
"codelyzer": "~3.1.1",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"jquery": "^3.2.1",
"jquery-ui-dist": "^1.12.1",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-animate": "^0.3.1",
"ng-pick-datetime": "^5.0.0-beta.11",
"ng-sweetalert2-slc": "^0.1.7",
"ng2-archwizard": "^2.1.0",
"ng2-charts": "^1.6.0",
"ng2-completer": "^1.6.3",
"ng2-datetime-picker": "^0.15.1",
"ng2-map": "^0.16.5",
"ng2-simple-autocomplete": "^0.6.1",
"ng2-smart-table": "^1.2.2",
"ng2-sweetalert2": "0.0.8",
"ng2-toasty": "^4.0.3",
"ng2-validation": "^4.2.0",
"ngx-facebook": "^2.4.0",
"node-sass": "^4.11.0",
"popper.js": "^1.12.6",
"protractor": "~5.1.2",
"rxjs": "^5.5.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"typescript": "~2.3.3",
"zone.js": "^0.8.18"
},
"devDependencies": {}
}
这是新的package.json发布:
{
"name": "test123",
"version": "0.0.0",
"license": "MIT",
"private": true,
"dependencies": {
"@angular/animations": "^7.2.15",
"@angular/common": "^7.2.15",
"@angular/compiler": "^7.2.15",
"@angular/compiler-cli": "^7.2.15",
"@angular/core": "^7.2.15",
"@angular/forms": "^7.2.15",
"@angular/http": "^7.2.15",
"@angular/language-service": "^7.2.15",
"@angular/platform-browser": "^7.2.15",
"@angular/platform-browser-dynamic": "^7.2.15",
"@angular/platform-server": "^7.2.15",
"@angular/router": "^7.2.15",
"@jaspero/ng2-confirmations": "^0.3.3",
"@types/google-maps": "^3.2.0",
"@types/jasmine": "~3.3.12",
"@types/jasminewd2": "~2.0.2",
"@types/node": "^12.0.0",
"angular-confirmation-popover": "^4.2.0",
"angular-font-awesome": "^3.1.2",
"angular2-datatable-pagination": "0.0.3",
"angular2-json2csv": "^1.1.2",
"angular2-lightbox": "^1.2.1",
"bootstrap": "^4.3.1",
"chart.js": "^2.7.1",
"codelyzer": "~5.0.1",
"core-js": "^3.0.1",
"font-awesome": "^4.7.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"jquery": "^3.2.1",
"jquery-ui-dist": "^1.12.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.5",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"ng-animate": "^0.3.1",
"ng-pick-datetime": "^7.0.0",
"ng-sweetalert2-slc": "^0.1.7",
"ng2-archwizard": "^2.1.0",
"ng2-charts": "^2.2.3",
"ng2-completer": "^2.0.8",
"ng2-datetime-picker": "^0.15.1",
"ng2-map": "^0.16.5",
"ng2-simple-autocomplete": "^0.6.1",
"ng2-smart-table": "^1.2.2",
"ng2-sweetalert2": "0.0.8",
"ng2-toasty": "^4.0.3",
"ng2-validation": "^4.2.0",
"ngx-facebook": "^2.4.0",
"node-sass": "^4.11.0",
"popper.js": "^1.12.6",
"protractor": "~5.4.2",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.0.0-rc.0",
"ts-node": "~8.1.0",
"tslib": "^1.9.0",
"tslint": "~5.16.0",
"typescript": "~3.1.6",
"webpack": "^4.31.0",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular/cli": "^7.3.9",
"@angular-devkit/build-angular": "~0.13.0"
}
}
进行迁移时,在命令'ng serve'上出错:
找不到“ AppModule”的NgModule元数据中的错误。 webpack:编译失败。
甚至在命令'ng build --prod'上发现的错误:
ERROR in:TypeError:无法读取未定义的属性“标志” 在checkUnreachable(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:29004:31) 在bindChildrenWorker(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:27023:17) 在bindChildren(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26979:17) 在bind(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:28257:21) 在bindSourceFile(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26593:17) 在Object.bindSourceFile(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:26534:9) 在initializeTypeChecker(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:56480:20) 在Object.createTypeChecker(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:30758:9) 在getDiagnosticsProducingTypeChecker(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85043:93) 在/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85171:35 在runWithCancellationToken(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85144:24) 在getSemanticDiagnosticsForFileNoCache(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85167:20) 在getAndCacheDiagnostics(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85415:26) 在getSemanticDiagnosticsForFile(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85164:20) 在getDiagnosticsHelper(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85106:24) 在Object.getSemanticDiagnostics(/home/chaitalimehta/workspace/beyou/public/angular/node_modules/typescript/lib/typescript.js:85119:20)
尝试清除缓存并重新安装:
尝试使用链接从头开始迁移:
尝试删除打字稿,然后先删除tslint,然后删除angular-cli
试图更改打字稿,tslint,angular-cli的版本
尝试了许多其他事情,没有任何解决方案对我有用。