Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local install / no admin rights / sls run fails because it tries a global install of the emulator #133

Open
aheissenberger opened this issue Sep 29, 2017 · 2 comments

Comments

@aheissenberger
Copy link

I am using "serverless" installed local with the project and would like to do this with the emulator too.
But whenever I call ../../node_modules/.bin/sls run (serverless/serverless#4034 (comment)) it tries to do a global install and fails on my system as I do not have admin rights:

$ ../../node_modules/.bin/sls run
 Serverless     Installing Emulator
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ah/.npm/_logs/2017-09-20T19_38_14_739Z-debug.log
 
  Error --------------------------------------------------
 
  Command failed: npm install -g @serverless/emulator@0.1.18
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ah/.npm/_logs/2017-09-20T19_38_14_739Z-debug.log

 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.5.0
     Serverless Version:     1.22.0

packages.json

"devDependencies": {
   "serverless": "^1.22.0",
    "@serverless/emulator": "0.1.18"
  }
@ericstephens
Copy link

is there a way to install the emulator once (as sudo / root), then go about testing as non-root? I'm having the same problem.

@tpesce
Copy link

tpesce commented Jun 13, 2018

I've run into this issue as well and am hoping for suggestions to work around the problem. NVM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants