Я создал угловое приложение, которое хочу развернуть на heroku, но сборка не удалась. Я выполнил шаги, предоставленные https://itnext.io/how-to-deploy-angular-application-to-heroku-1d56e09c5147, и не получил его на работу. Какие изменения необходимы для этой работы?
Here's my build log
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): v10.16.3
engines.npm (package.json): 6.9.0
Resolving node version v10.16.3...
Downloading and installing node 10.16.3...
npm 6.9.0 already installed with node
-----> Restoring cache
- node_modules
-----> Installing dependencies
Installing node modules (package.json + package-lock)
> core-js@2.6.9 postinstall /tmp/build_4cf23a391f9c002e9d1c85d30acc96ae/node_modules/babel-runtime/node_modules/core-js
> node scripts/postinstall || echo "ignore"
> core-js@3.2.1 postinstall /tmp/build_4cf23a391f9c002e9d1c85d30acc96ae/node_modules/core-js
> node scripts/postinstall || echo "ignore"
> core-js@2.6.9 postinstall /tmp/build_4cf23a391f9c002e9d1c85d30acc96ae/node_modules/karma/node_modules/core-js
> node scripts/postinstall || echo "ignore"
> @angular/cli@8.3.9 postinstall /tmp/build_4cf23a391f9c002e9d1c85d30acc96ae/node_modules/@angular/cli
> node ./bin/postinstall/script.js
> bjornlidenfix@0.0.0 postinstall /tmp/build_4cf23a391f9c002e9d1c85d30acc96ae
> ng build --aot -prod
Unknown option: '-d'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bjornlidenfix@0.0.0 postinstall: `ng build --aot -prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bjornlidenfix@0.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.00JQ7/_logs/2019-10-13T16_59_55_855Z-debug.log
-----> Build failed
! Push rejected, failed to compile Node.js app.
! Push failed
Вот мой файл package.json
{
"name": "bjornliden",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall": "ng build --aot -prod"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.2.9",
"@angular/cli": "~8.3.9",
"@angular/common": "~8.2.9",
"@angular/compiler": "~8.2.9",
"@angular/compiler-cli": "~8.2.9",
"@angular/core": "~8.2.9",
"@angular/forms": "~8.2.9",
"@angular/platform-browser": "~8.2.9",
"@angular/platform-browser-dynamic": "~8.2.9",
"@angular/router": "~8.2.9",
"contentful": "^7.10.0",
"express": "^4.17.1",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"typescript": "~3.5.3",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.9",
"@angular/language-service": "~8.2.9",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0"
},
"engines": {
"node": "v10.16.3",
"npm": "6.9.0"
}
}