I'm trying to install LESS on my machine and have installed node already. However, when I enter "node install -g less" I get the following error and am not sure what to do?
FPaulMAC:bin paul$ npm install -g less npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/less' npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/less'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/usr/local/lib/node_modules/less' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! System Darwin 13.3.0 npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "less" npm ERR! cwd /usr/local/bin npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! path /usr/local/lib/node_modules/less npm ERR! code EACCES npm ERR! errno 3 npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/less' npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/less' npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/less'] npm ERR! error rolling back errno: 3, npm ERR! error rolling back code: 'EACCES', npm ERR! error rolling back path: '/usr/local/lib/node_modules/less' } npm ERR! not ok code 0
To run commands with superuser privileges, use the sudo command. sudo stands for superuser do. You're asked for the password of the current user. You're asked to enter the password for adminUsername, after which a new shell is opened for that user.
Any global installs will cache packages to /root/. npm instead of root -owned files at /home/me/. npm . Just always use sudo -i or sudo -H when running npm install to install global packages and your npm permissions problems will melt away.
Re Explosion Pills "An installation can run arbitrary scripts and running it with sudo can be extremely dangerous!"
Seems like using sudo is the wrong way of doing it.
"Change the owner of the files in your /usr/local folder to the current user:"
sudo chown -R $USER /usr/local
Then run the install
node install -g less
Check out:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With