脚本错误。 xxxjs 来自 Terser 构建 angular 构建 angular 项目以部署到 heroku
ERROR in scripts. xxxjs from Terser when building angular when building angular project to deploy to heroku
我想将我的代码部署到 heroku,但在构建我的 angular 应用程序时总是遇到错误。我尝试使用以下命令来构建我的 angular 项目。
'ng build --prod','ng build --aot --prod'
这两个命令都导致相同的错误。
ng build --aot --prod
click to view the error
附上我的 package.json,为包 -lock.json 添加了屏幕截图。 packagelock.json packagelock
{
"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
它指出了整个应用程序中有句法的地方。一旦解决,我的构建就成功了
我想将我的代码部署到 heroku,但在构建我的 angular 应用程序时总是遇到错误。我尝试使用以下命令来构建我的 angular 项目。 'ng build --prod','ng build --aot --prod' 这两个命令都导致相同的错误。 ng build --aot --prod click to view the error
附上我的 package.json,为包 -lock.json 添加了屏幕截图。 packagelock.json packagelock
{
"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
它指出了整个应用程序中有句法的地方。一旦解决,我的构建就成功了