Node.js Node server.js无法从elastic beanstalk获取环境变量
我尝试在AWS Elastic Beanstalk上使用AWS CodeBuild启动node.js项目。我将我的env变量放在软件配置下的Elastic Beanstalk配置中。之后,我将项目部署到Elastic Beanstalk,我的server.js没有环境变量 我在server.js的顶部实现了一个console.log(process.env),但在Elastic Beanstalk配置中没有填充任何env变量。我参观了弹性豆茎原木 我的日志还显示:Node.js Node server.js无法从elastic beanstalk获取环境变量,node.js,amazon-web-services,environment-variables,aws-codebuild,Node.js,Amazon Web Services,Environment Variables,Aws Codebuild,我尝试在AWS Elastic Beanstalk上使用AWS CodeBuild启动node.js项目。我将我的env变量放在软件配置下的Elastic Beanstalk配置中。之后,我将项目部署到Elastic Beanstalk,我的server.js没有环境变量 我在server.js的顶部实现了一个console.log(process.env),但在Elastic Beanstalk配置中没有填充任何env变量。我参观了弹性豆茎原木 我的日志还显示: Error: Redis co
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at Object.exports._errnoException (util.js:1018:11)
at exports._exceptionWithHostPort (util.js:1041:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
npm ERR! Linux 4.9.43-17.39.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.11.1-linux-
x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.11.1-linux-
x64/bin/npm" "run" "start"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! xxxxxxx start: `NODE_ENV=production node server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxxxxxx start script 'NODE_ENV=production node server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the xxxxxxx package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_ENV=production node server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs xxxxxxx
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls mapify-ssr
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/app/current/npm-debug.log
检查您使用的是限制字符还是超过了总的最大大小?@GabrielBleu感谢您的提示。我检查了它们,它们没有限制字符,而且非常小。事件中没有错误吗?重建环境可能help@GabrielBleu我刚刚开始重建环境。@GabrielBleu日志输出中仍然没有环境变量