【发布时间】:2020-08-01 05:31:57
【问题描述】:
当我尝试在 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;
【问题讨论】:
-
我认为 npm install 丢失了:s 但 elasticbean 必须为您运行它:docs.aws.amazon.com/elasticbeanstalk/latest/dg/…
-
@JRichardsz 我现在要尝试一下..
-
我的 Currter package.json
-
{ "name": "app", "version": "1.0.0", "description": "Firsy Spp", "main": "index.js", "dependencies": {}, "devDependencies": { "express": "^4.17.1" }, "scripts": { "start": "node index.js", "test": "echo \"错误:没有指定测试\ " && exit 1" }, "keywords": [], "author": "", "license": "ISC" }
标签: node.js amazon-web-services npm amazon-elastic-beanstalk