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

npm install permissions error #2

Open
stephlocke opened this issue Oct 9, 2019 · 2 comments
Open

npm install permissions error #2

stephlocke opened this issue Oct 9, 2019 · 2 comments

Comments

@stephlocke
Copy link

I'm using the extension and have a pipeline like:

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: Npm@1
  inputs:
    command: 'install'
- task: install@1

When this is running, the install netlify cli is having permissions issues

2019-10-09T15:54:19.0714842Z ##[section]Starting: install
2019-10-09T15:54:19.0717164Z ==============================================================================
2019-10-09T15:54:19.0717229Z Task         : Install Netlify CLI
2019-10-09T15:54:19.0717260Z Description  : Install Netlify CLI
2019-10-09T15:54:19.0717293Z Version      : 1.0.0
2019-10-09T15:54:19.0717340Z Author       : Justin Yoo
2019-10-09T15:54:19.0717372Z Help         : This installs the netlify-cli
2019-10-09T15:54:19.0717404Z ==============================================================================
2019-10-09T15:54:19.2078334Z [command]/usr/local/bin/npm install -g netlify-cli
2019-10-09T15:54:23.3179428Z npm WARN deprecated [email protected]: I wrote this module a very long time ago; you should use something else.
2019-10-09T15:54:36.8245247Z npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
2019-10-09T15:54:37.0444842Z npm ERR! code EACCES
2019-10-09T15:54:37.0445656Z npm ERR! syscall access
2019-10-09T15:54:37.0446041Z npm ERR! path /usr/local/lib/node_modules
2019-10-09T15:54:37.0447901Z npm ERR! errno -13
2019-10-09T15:54:37.0463467Z npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
2019-10-09T15:54:37.0464287Z npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
2019-10-09T15:54:37.0464644Z npm ERR!   stack:
2019-10-09T15:54:37.0465213Z npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
2019-10-09T15:54:37.0465803Z npm ERR!   errno: -13,
2019-10-09T15:54:37.0466413Z npm ERR!   code: 'EACCES',
2019-10-09T15:54:37.0467919Z npm ERR!   syscall: 'access',
2019-10-09T15:54:37.0468566Z npm ERR!   path: '/usr/local/lib/node_modules' }
2019-10-09T15:54:37.0468934Z npm ERR! 
2019-10-09T15:54:37.0469181Z npm ERR! The operation was rejected by your operating system.
2019-10-09T15:54:37.0469464Z npm ERR! It is likely you do not have the permissions to access this file as the current user
2019-10-09T15:54:37.0469724Z npm ERR! 
2019-10-09T15:54:37.0470236Z npm ERR! If you believe this might be a permissions issue, please double-check the
2019-10-09T15:54:37.0470586Z npm ERR! permissions of the file and its containing directories, or try running
2019-10-09T15:54:37.0470842Z npm ERR! the command again as root/Administrator.
2019-10-09T15:54:37.0732682Z 
2019-10-09T15:54:37.0733543Z npm ERR! A complete log of this run can be found in:
2019-10-09T15:54:37.0736678Z npm ERR!     /home/vsts/.npm/_logs/2019-10-09T15_54_37_052Z-debug.log
2019-10-09T15:54:37.0984426Z ##[error]The process '/usr/local/bin/npm' failed with exit code 243

Any idea why this is attempting to install differently to the npm task above it? (it also errored by itself but I added the npm step to ensure it wasn't a general issue)

@justinyoo
Copy link
Collaborator

@stephlocke Thanks for the issue!

It's because it misses sudo. I need to figure out how to put sudo if the build agent is not Windows.

@binyamin
Copy link

binyamin commented Nov 4, 2019

@justinyoo would it work to manually add a script that says sudo npm install -g netlify-cli?

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

No branches or pull requests

3 participants