I am trying to deploy my node app to AWS. It won't even let me deploy the application (stays as Sample Application
) using eb deploy.
Version: 64bit Amazon Linux 2016.09 v4.0.1 running Node.js
The logs say
Failed to run npm install
But am not too sure what else they're asking me to do to fix it. I can npm install just fine locally:
-------------------------------------
/var/log/eb-activity.log
-------------------------------------
Failed to run npm install. Snapshot logs for more details.
Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in <module>
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)
A snapshot of the overview page:
Eb deploy failure message:
$ eb deploy
Creating application version archive "app-bdfdd-170514_152527".
Uploading: [##################################################] 100% Done...
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: Failed to run npm install. Snapshot logs for more details.
ERROR: [Instance: i-09af789a519075c5e] Command failed on instance. Return code: 1 Output: (TRUNCATED).../opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v6.10.0-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-09af789a519075c5e'. Aborting the operation.
ERROR: Failed to deploy application.
ERROR: Failed to deploy application.
My ebextensions file (at .ebextentions/config.config
), default:
packages:
yum:
git: []
cairo: []
cairo-devel: []
libjpeg-turbo-devel: []
giflib-devel: []
Package.json file
{
"name": "live-demos",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"gulp": "gulp",
"start": "node app.js",
"start:dev": "browserify ./js/about.js -o ./build/js/bundle.js && gulp build-dev"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.x.x",
"browserify": "^13.1.0",
"canvas": "^1.4.0",
"d3": "^3.5.17",
"d3.layout.cloud": "^1.2.0",
"ejs": "^2.5.1",
"express": "^4.13.1",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-compass": "^2.1.0",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.0",
"gulp-nodemon": "^2.0.4",
"gulp-sass": "^2.0.4",
"isotope-layout": "^3.0.1",
"request": "^2.74.0",
"request-promise": "^4.1.1"
},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-browserify": "^0.5.1",
"gulp-nodemon": "^2.0.4"
}
}