我正在尝试在 Heroku 服务器中部署我的 Node/Angular 应用程序,日志文件没有提供任何有用的信息。
我尝试更改 Node 和 npm 版本,我按照 https://devcenter.heroku.com/articles/troubleshooting-node-deploys 中的步骤操作,但什么也没发生
这个问题不允许我初始化应用程序,然后我不知道服务器是否工作或者我有什么错误。
...///...
-----> Creating runtime environment
...///...
-----> Installing binaries
...///...
-----> Restoring cache
...///...
-----> Installing dependencies
...///...
-----> Build
Detected both "build" and "heroku-postbuild" scripts
Running heroku-postbuild
> opord-easy-app@0.0.0 heroku-postbuild
> ng build --configuration production
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
这是我的 package.json 文件。
{
"name": "opord-easy-app",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server/index.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"dev": "nodemon server/index.js",
"heroku-postbuild": "ng build --configuration production"
},
"private": true,
"dependencies": {
"@angular/animations": "~11.2.9",
"@angular/cdk": "^11.2.9",
"@angular/cli": "^12.0.1",
"@angular/common": "~11.2.9",
"@angular/compiler": "~11.2.9",
"@angular/compiler-cli": "~11.2.9",
"@angular/core": "~11.2.9",
"@angular/forms": "~11.2.9",
"@angular/material": "^11.2.9",
"@angular/platform-browser": "~11.2.9",
"@angular/platform-browser-dynamic": "~11.2.9",
"@angular/router": "~11.2.9",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
"@types/ol": "^6.4.2",
"cors": "^2.8.5",
"express": "^4.17.1",
"heroku": "^7.54.0",
"mongoose": "^5.12.7",
"morgan": "^1.10.0",
"ol": "^6.5.0",
"ol-ext": "^3.1.19",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"typescript": "~4.1.5",
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1102.8",
"@angular/cli": "^12.0.1",
"@angular/compiler-cli": "~11.2.9",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"nodemon": "^2.0.7",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.1.5"
},
"engines": {
"node": "14.x",
"npm": "7.7.6"
}
}