【发布时间】:2021-01-13 11:08:22
【问题描述】:
我想使用 Heroku 部署我的 MEAN 堆栈应用程序。我关注this tutorial series 主要是为了构建我的应用程序。但是当我通过推送到 GIT 开始部署时,它在构建过程中给了我这个错误:
meanstacknieuw@1.0.0 postinstall /tmp/build_837e48e6_
> cd client && ng build --aot --prod
You seem to not be depending on "@angular/core" and/or "rxjs". This is an error.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! meanstacknieuw@1.0.0 postinstall: `cd client && ng build --aot --prod`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the meanstacknieuw@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
这是我的 package.json(服务器端的):
{
"name": "meanstacknieuw",
"version": "1.0.0",
"description": "refreshing",
"main": "index.js",
"engines": {
"node": "10.16.3",
"npm": "6.11.3"
},
"scripts": {
"ng": "ng",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js",
"build": "ng build",
"heroku-postbuild": "cd client && ng build --aot --prod",
"postinstall": "cd client && ng build --aot --prod"
},
"repository": {
"type": "git",
"url": "git+https://github.com/y0u-s/vf-app.git"
},
"keywords": [
"MEAN",
"stack",
"angular",
"2",
"application"
],
"author": "Youssef",
"license": "ISC",
"bugs": {
"url": "https://github.com/y0u-s/latest-mean-stack-app/issues"
},
"homepage": "https://github.com/y0u-s/latest-mean-stack-app#readme",
"dependencies": {
"@angular/cli": "^8.3.20",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"angular2-flash-messages": "^3.0.1",
"bcrypt": "^3.0.4",
"body-parser": "^1.18.3",
"cors": "^2.8.5",
"express": "^4.16.4",
"file-extension": "^4.0.5",
"jsonwebtoken": "^8.5.1",
"multer": "^1.4.2",
"node-localstorage": "^2.1.4",
"nodemailer": "^6.4.1",
"simple-odata-server": "^1.1.1",
"typescript": "~3.2.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.20"
}
}
怎么了?请让我知道您需要更多上下文。
编辑:
-----> Restoring cache
Cached directories were not restored due to a change in version of
node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Installing node modules
npm ERR! cipm can only install packages when your package.json and
package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock
file with `npm install` before continuing.
npm ERR!
npm ERR!
npm ERR! Missing: @angular/rxjs@^8.2.14
npm ERR! Missing: @angular/core@^8.2.14
npm ERR! Missing: @angular/common@^8.2.14
npm ERR! Missing: @angular/platform-browser@^8.2.14
npm ERR!
【问题讨论】:
标签: angular heroku deployment mean