ember-fastboot / ember-fastboot/fastboot-aws

Permission Error running `npm install` on elasticbeanstalk

Open
#4 17 comments 12 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
50
Forks
16
PR merge metrics
No merged PRs in 30d

Description

I've managed to successfully create an Elastic Beanstalk app following the documentation.

The ember app itself is zipped and deployed to S3 via `ember-cli-deploy-elastic-beanstalk`, which the eb server manages to successfully download and unzip, however a permission error is logged when `fastboot-s3-downloader` tries to run `cd deploy-dist && npm install`:

```
No FASTBOOT_REDIS_HOST or FASTBOOT_REDIS_PORT provided; caching is disabled.
[2016-12-27T17:04:27.885Z][m3467] downloading app
[2016-12-27T17:04:27.886Z][m3467] fetching current app version from cb-ember-assets-staging/fastboot-dist.json
[2016-12-27T17:04:28.007Z][m3467] got config { bucket: 'cb-ember-assets-staging',
key: 'deploy-dist-be5a0f41c7886b05bfe3bbaa36f48985.zip' }
[2016-12-27T17:04:28.012Z][m3467] removing deploy-dist
[2016-12-27T17:04:28.023Z][m3467] saving S3 object cb-ember-assets-staging/deploy-dist-be5a0f41c7886b05bfe3bbaa36f48985.zip to deploy-dist-be5a0f41c7886b05bfe3bbaa36f48985.zip
[2016-12-27T17:04:28.234Z][m3467] unzipped deploy-dist-be5a0f41c7886b05bfe3bbaa36f48985.zip
[2016-12-27T17:04:28.881Z][m3467] error running command cd deploy-dist && npm install
[2016-12-27T17:04:28.881Z][m3467] npm WARN locking Error: EACCES: permission denied, open '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock'
npm WARN locking at Error (native)
npm WARN locking /tmp/.npm/_locks/staging-f212e8d64a01707f.lock failed { Error: EACCES: permission denied, open '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock'
npm WARN locking at Error (native)
npm WARN locking errno: -13,
npm WARN locking code: 'EACCES',
npm WARN locking syscall: 'open',
npm WARN locking path: '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock' }
npm WARN deploy-dist No description
npm WARN deploy-dist No repository field.
npm WARN deploy-dist No license field.
npm ERR! Linux 4.4.35-33.55.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v6.9.1-linux-x64/bin/npm" "install"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! path /tmp/.npm/_locks/staging-f212e8d64a01707f.lock
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, open '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/tmp/.npm/_locks/staging-f212e8d64a01707f.lock' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /var/app/current/deploy-dist/npm-debug.log

[2016-12-27T17:04:28.881Z][m3467] unable to install npm dependencies
[2016-12-27T17:04:28.882Z][m3467] subscribing to update notifications
[2016-12-27T17:04:28.918Z][m3467] forked worker 3530
[2016-12-27T17:04:28.919Z][m3467] worker online
No FASTBOOT_REDIS_HOST or FASTBOOT_REDIS_PORT provided; caching is disabled.
[2016-12-27T17:04:29.697Z][w3530] starting HTTP server
[2016-12-27T17:04:29.708Z][w3530] HTTP server started; url=http://:::8081
```

The server is able to start regardless, because ember-deploy includes `node_modules` as part of `dist-deploy.zip`, but it would be nice to avoid this error.

A brute force solution would be to have `fastboot-s3-downloader` run `npm install` with `sudo`, but that probably should be avoided.

Would appreciate any help if anyone dealt with this issue as well.

Things tried so far that didn't work:
- [`mkdir ~/.npm-global ` && `NPM_CONFIG_PREFIX=~/.npm-global`](https://docs.npmjs.com/getting-started/fixing-npm-permissions)
- not including `node_modules` as part of `ember deploy` `dist-deploy.zip`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.