[英]"You seem to not be depending on "@angular/core" and/or "rxjs". This is an error. " when deploying MEAN-app to Heroku
I want to deploy my MEAN-stack application using Heroku.我想使用 Heroku 部署我的 MEAN-stack 应用程序。 I have followed this tutorial series mostly to build my app.
我主要遵循本教程系列来构建我的应用程序。 But when I start deployment by pushing to GIT, it gives me this error during the build process:
但是当我通过推送到 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.
this is my package.json (of the server side):这是我的 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"
}
}
Whats going wrong?怎么了? Please let me know i you need more context.
请让我知道您需要更多上下文。
EDIT:编辑:
-----> 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!
Did you check if you already have the node_modules
directory under your project directory?您是否检查过您的项目目录下是否已经有
node_modules
目录? If so, remove the directory and reinstall npm install
.如果是这样,请删除该目录并重新安装
npm install
。
And I noticed you don't have @angular/core
and rxjs
in package.json
.我注意到
package.json
没有@angular/core
和rxjs
。 Please add them by doing npm install @angular/core rxjs --save
.请通过执行
npm install @angular/core rxjs --save
添加它们。 Also you should have @angular/common, @angular/platform-browser
, too.你也应该有
@angular/common, @angular/platform-browser
。
You don't have all the required dependencies to run an Angular project.您没有运行 Angular 项目所需的所有依赖项。 Typical dependencies are as follows (you may need different versions):
典型的依赖如下(你可能需要不同的版本):
"dependencies": {
"@angular/animations": "^10.1.0",
"@angular/common": "^10.1.0",
"@angular/compiler": "^10.1.0",
"@angular/core": "^10.1.0",
"@angular/forms": "^10.1.0",
"@angular/platform-browser": "^10.1.0",
"@angular/platform-browser-dynamic": "^10.1.0",
"@angular/router": "^10.1.0",
"@angular/material": "^10.1.2",
"@angular/cdk": "^10.1.2",
"typescript": "~3.9.5",
"rxjs": "~6.5.3",
"zone.js": "~0.10.3",
"core-js": "^2.5.4",
"csstype": "^2.5.8",
"tslib": "^1.10.0"
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.