1

When I execute command: npm install -g @angular/cli I get an error:

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!   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!     /home/my_user_name/.npm/_logs/2017-07-13T13_36_06_285Z-debug.log

And then I tried to execute command: sudo npm install -g @angular/cli but I got an error:

npm ERR! path /usr/local/bin/ng
npm ERR! code EEXIST
npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/angular-cli/bin/ng symlink target is not controlled by npm /usr/local/bin
npm ERR! File exists: /usr/local/bin/ng
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/my_user_name/.npm/_logs/2017-07-13T13_39_01_642Z-debug.log

How can I install Angular-CLI if even sudo priviliges are not sufficient?

2
  • Try to remove /usr/local/bin/ng manualy (as root) Commented Jul 13, 2017 at 14:46
  • I do it and now I get an error which is described github.com/angular/angular-cli/issues/6848 but solution doesn't work in my example. Commented Jul 13, 2017 at 14:59

1 Answer 1

1

It looks like a write issue.

You have two options to use sudo (not the best option) or change the folder owner.

  1. sudo npm install -g @angular/cli
  2. sudo chown -R $USER /usr/local/lib/node_modules

Check content symlink path eventually reinstall duplicity a set rights.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.