Node JS和AWS Elastic Beanstalk遇到问题

时间:2020-04-18 17:19:01

标签: node.js amazon-web-services npm amazon-elastic-beanstalk

当我尝试在elasitcbeanstalk中构建我的应用程序时,我遇到了不断出现的错误

var / log / nodejs / nodejs.log

Error: Cannot find module 'express'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/var/app/current/index.js:1:17)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
npm ERR! app@1.0.0 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the app@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

> app@1.0.0 start /var/app/current
 > node index.js

internal/modules/cjs/loader.js:638
throw err;

1 个答案:

答案 0 :(得分:0)

使用以下命令在NodeCommand中尝试:“ npm install && npm run start”