简体   繁体   English

Heroku 部署 - 发生未处理的异常:找不到模块“@angular-devkit/build-angular/package.json”

[英]Heroku deploy - An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'

My project runs perfectly on my local machine, but getting this error when trying to deploy live to Heroku:我的项目在我的本地机器上运行完美,但在尝试实时部署到 Heroku 时出现此错误:

I am getting the error: An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'我收到错误:发生未处理的异常:找不到模块“@angular-devkit/build-angular/package.json”

I have updated my Heroku engines to match my local machine as well:我已经更新了我的 Heroku 引擎以匹配我的本地机器:

"engines": {
  "node": "12.16.2",
  "npm": "6.14.4"
}

This is sitting in my dev dependencies:这是坐在我的开发依赖:

"@angular-devkit/build-angular": "^0.901.1"

Here is the full Heroku log --tail errors:这是完整的 Heroku 日志 --tail 错误:

admin-platform@0.0.0 start /app
ng serve
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
/app/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
/app/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
/app/node_modules/@angular/cli/models/architect-command.js
/app/node_modules/@angular/cli/commands/serve-impl.js
/app/node_modules/@angular-devkit/schematics/tools/export-ref.js
/app/node_modules/@angular-devkit/schematics/tools/index.js
/app/node_modules/@angular/cli/utilities/json-schema.js
/app/node_modules/@angular/cli/models/command-runner.js
/app/node_modules/@angular/cli/lib/cli/index.js
/app/node_modules/@angular/cli/lib/init.js
/app/node_modules/@angular/cli/bin/ng

Thank you in advance!先感谢您!

Just copy "@angular-devkit/build-angular": "^0.901.1" from devDependencies to dependencies in your package.json file.只需将 "@angular-devkit/build-angular": "^0.901.1" 从 devDependencies 复制到 package.json 文件中的依赖项。 Had the same problem few minutes ago.几分钟前遇到了同样的问题。

"dependencies": {
  "@angular-devkit/build-angular": "^0.901.1",
   ...
}

Be sure to change your start script to "node server.js" or the name of your server file, for further troubleshooting, here is a guide on how to deploy an angular app to heroku https://medium.com/@ryanchenkie_40935/angular-cli-deployment-host-your-angular-2-app-on-heroku-3f266f13f352请务必将启动脚本更改为“node server.js”或服务器文件的名称,以便进一步排除故障,这是有关如何将 angular 应用程序部署到 heroku https://medium.com/@ryanchenkie_40935/的指南angular-cli-deployment-host-your-angular-2-app-on-heroku-3f266f13f352

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 发生未处理的异常:找不到模块 '@angular-devkit/build-angular/package.json' 需要堆栈: - An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack: 我收到此错误:发生未处理的异常:找不到模块'@angular-devkit/build-angular/package.json' 需要堆栈: - I get this error: An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json' Require stack: 角度错误:未处理的异常:找不到模块@angular-devkit/build-angular/package.json - angular-error: unhandled exception: cannot find module @angular-devkit/build-angular/package.json 错误:找不到模块'@angular-devkit/build-angular/package.json' - Error: Cannot find module '@angular-devkit/build-angular/package.json' 发生未处理的异常:找不到模块“@angular-devkit/build-angular” - An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" 发生未处理的异常:找不到模块“@angular-devkit/build-angular”从“/project 到 docker - An unhandled exception occurred: Could not find module “@angular-devkit/build-angular” from "/project into a docker 尝试在 Angular 项目中运行 ng serve 时出现问题'找不到模块“@angular-devkit/build-angular/package.json'” - Problem trying to run ng serve in Angular Project 'Cannot find module “@angular-devkit/build-angular/package.json' ” 在 docker-compose 期间找不到模块 @angular-devkit/build-angular/package.json - Cannot find module @angular-devkit/build-angular/package.json during docker-compose up 发生未处理的异常:找不到 builder @angular-devkit/build-angular:dev-server 的实现 - An unhandled exception occurred: Could not find the implementation for builder @angular-devkit/build-angular:dev-server 发生未处理的异常:无法从“/ang-frontend”找到模块“@angular-devkit/build-angular”。 使用 docker 和 docker-compose - An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" from "/ang-frontend". with docker and docker-compose
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM