Tag: elastic beanstalk

AWS弹性beanstalk ec2服务器上的node.js命令

我在AWS上创build了一个弹性beanstalk node.js应用程序,它为我创build了EC2和RDS服务器。 我正在使用putty连接到我的Linux EC2实例,该实例已成功login, 但问题是当我键入一些(节点)命令,如: node -v npm install express -g node 它给了我一个错误: bash:node:找不到命令

AWS Elastic Beanstalk – 如何使用npm和webpack构buildbundle JS

我有一个节点js应用程序部署在elasticbeanstalk。 安装和符号链接节点,npm和webpack。 但是在运行npm run build-prod ,它自己调用脚本webpack –config /var/app/current/webpack.prod.config.js 。 以退出状态-2获取以下错误。 如果我也直接运行webpack命令,也会发生同样的情况。 我正在寻找解决scheme。 [2016-07-26T06:57:36.301Z] INFO [9731] – [Application update app-5c81-160726_122417@24/AppDeployStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_site_web/Command 06_npm_run_build_prod] : Activity execution failed, because: > site-web@1.0.0 build-prod /tmp/deployment/application > webpack –config /var/app/current/webpack.prod.config.js npm ERR! Linux 4.4.14-24.50.amzn1.x86_64 npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/node" "/bin/npm" "run" "build-prod" npm ERR! node v4.4.6 npm ERR! npm v2.15.5 npm ERR! file […]

我应该在哪里存储我的Node.js应用程序的密钥?

我真的很困难,我应该如何隐藏我的钥匙。 我需要隐藏的两个密钥是secrets.crypto和secrets.jwt …我打算使用Elastic Beanstalk在AWS上托pipe我的应用程序。 此外,我不知道在哪里我会把我的钥匙,以访问像我的Dynamodb和我的S3桶。 exports.generateToken = (type, user) => { if (!_.isString(type)) { return undefined; } try { //Turn the json object of the current user's id and the type of token into a string var stringData = JSON.stringify({ _id: user._id, type: type }); //Take the json string and encrypt it with a secret […]

npm全局安装在弹性豆茎上

我正在遇到一个安装PM2的问题,在aws elastic beanstalk上全局安装。 我创build了以下用于安装pm2的脚本: option_settings: – option_name: NODE_ENV value: production container_commands: 01_enable_rootaccess: command: echo Defaults:root \!requiretty >> /etc/sudoers 02_install_imagemagic: command: yum install -y ImageMagick 03_download_new_relic: command: rpm -Uvh http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm ignoreErrors: true 04_install_new_relic: command: yum install -y newrelic-sysmond ignoreErrors: true 05_add_license_key: command: /usr/sbin/nrsysmond-config –set license_key=xxxxxxx ignoreErrors: true 06_start_new_relic: command: /etc/init.d/newrelic-sysmond start ignoreErrors: true 07_install_pm2: command: sudo […]

在ElasticBeanstalk上运行Grunt

我有一个节点应用程序需要咕噜做一个“构build”,才能成功执行应用程序。 (运行连续/缩小/源代码转速等)。 我已经在具有SSH访问权限的EC2实例上运行了,因为我可以通过SSH进入目录并在部署过程中运行Grunt。 但是,为了实现这一点,我现在将应用程序移动到ElasticBeanstalk,而且我很难让应用程序成功运行grunt。 迁移到EB的原因是保持SSH密钥closures活动服务器,以便这些EB实例设置为不具有ssh访问权限。 似乎没有官方文件可以提供,有没有人可以指出我能够达到上述目标? 我需要在应用程序启动之前执行grunt以使应用程序具有可用的文件(否则将会有404)。

Amazon Elastic Beanstalk npm找不到package.json

我很新的amazon web services,我想在他们的弹性beanstalk上设置node.js应用程序。 我设置了实例并上传/部署了该站点,但是当健康状况为“好”时,node.js日志显示了这个重复的约30次: npm ERR! enoent ENOENT: no such file or directory, open '/var/app/current/package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any […]

弹性beanstalk t2服务器在哪里存储我的node.js应用程序文件?

从架构的angular度来看,我试图更好地理解如何以及在哪里存储部署到eb(t2)服务器的文件。 我看到s3中的一些.zip文件,显示了我通过eb接口上传了什么,但是究竟是如何/到底在我的ec2(t2)服务器上?