Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

npm, global install failing, getting Error: EACCES: permission denied

So I’m logged in as administrator of my MacBook and want to run a npm command in my Django project. However, It refuses due to missing permissions.

(venv) jonas@Air-von-Jonas salaryx % npm install -g sass
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/sass/sass.js
npm ERR! dest /usr/local/bin/sass
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/sass/sass.js' -> '/usr/local/bin/sass'
npm ERR!  [Error: EACCES: permission denied, symlink '../lib/node_modules/sass/sass.js' -> '/usr/local/bin/sass'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/sass/sass.js',
npm ERR!   dest: '/usr/local/bin/sass'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jonas/.npm/_logs/2022-03-24T06_04_35_362Z-debug.log
(venv) jonas@Air-von-Jonas salaryx % 

Also it seems that I can’t change permissions of a folder, I can unlock the lock on the bottom right but then once I try to change permission for "wheel" e.g. it refuses as well.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

An easy way to install globally a npm package is with the use of sudo command, like so:

sudo npm install -g sass
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading