【发布时间】:2018-07-19 09:01:30
【问题描述】:
我正在尝试将我的 React + API 服务器应用程序部署到 AWS Elastic Beanstalk,但现在遇到了一些问题。
我正在关注这个tutorial,我这样配置了我的 npm 脚本:
"scripts": {
"start": "concurrently \"npm run server\" \"npm run client\" ",
"server": "node server.js",
"client": "node start-client.js"
},
但是,当我阅读失败日志时,EC2 似乎无法找到 concurrently 命令。
Concurrently 安装为开发依赖项,但我知道 Elastic Beanstalk 也会安装开发依赖项,除非另有要求。
通过谷歌搜索,我怀疑 EC2 实例在其 PATH 中没有已安装节点包的位置,但我不太确定如何解决此问题。
编辑:我从 EBS 日志控制台复制了错误日志。
\> kid-server@0.0.0 start /var/app/current
\> concurrently "npm run server" "npm run client"
sh: concurrently: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! kid-server@0.0.0 start: `concurrently "npm run server" "npm run client" `
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the kid-server@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm update check failed
Try running with sudo or get access
to the local update config store via
sudo chown -R $USER:$(id -gn $USER) /tmp/.config
【问题讨论】:
-
您可以添加描述您的错误的日志吗?
-
@toddg 我编辑了我的帖子并添加了您要求的错误日志。
标签: node.js amazon-ec2 amazon-elastic-beanstalk