我想把我的代码部署到heroku上,但是我在构建我的angular应用时总是收到错误信息,我试过使用以下命令来构建我的angular项目。我试着用下面的命令来构建我的angular项目。'ng build --prod','ng build --aot --prod'这两个命令都导致了同样的错误。ng build --aot --prod。点击查看错误
附上我的package.json,添加package-lock.json的截图。packagelock.json 包锁
{
"name": "blog-frontend",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"postinstall": "ng build --output-path angularapp --aot --prod"
},
"e2e": "ng e2e",
"private": true,
"dependencies": {
"@angular/animations": "^9.1.9",
"@angular/cli": "~9.1.6",
"@angular/common": "~9.1.7",
"@angular/compiler": "~9.1.7",
"@angular/compiler-cli": "~9.1.7",
"@angular/core": "~9.1.7",
"@angular/forms": "~9.1.7",
"@angular/platform-browser": "~9.1.7",
"@angular/platform-browser-dynamic": "~9.1.7",
"@angular/router": "~9.1.7",
"bootstrap": "^4.5.0",
"express": "^4.17.1",
"jquery": "^3.5.1",
"ngx-toastr": "^12.0.1",
"path": "^0.12.7",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"typescript": "~3.8.3",
"zone.js": "~0.10.2"
},
"devDependencies": {
"bootstrap": "^4.5.0",
"@angular-devkit/build-angular": "~0.901.6",
"@angular/cli": "~9.1.6",
"@angular/compiler-cli": "~9.1.7",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
},
"engines": {
"node": "v12.16.3",
"npm": "6.14.4"
}
}
请你帮忙
当我使用下面的命令来构建Angular应用程序时,问题得到了解决。
build --prod --named-chunks --verbose --build-optimizer=false --source-map
它指出了哪里有一个语法上的贯穿应用。我的构建是成功的,一旦它被解决