Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symlink error when installing modules with npm

Tags:

node.js

npm

macos

I'm trying to install nodemon globally but I'm getting the following error:

npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "nodemon"
npm ERR! node v5.10.1
npm ERR! npm  v3.8.3
npm ERR! path ../lib/node_modules/nodemon/bin/nodemon.js
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall symlink

npm ERR! Error: EPERM: operation not permitted, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/local/bin/nodemon'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM: operation not permitted, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/local/bin/nodemon']
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR!   dest: '/usr/local/bin/nodemon' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Juanjo/Developer/budget-app/npm-debug.log

I'm new to node (literally the first thing I tried to run after installing it) but I don't think I'm supposed to use sudo to install modules, so perhaps there's something wrong with permissions or something, I just haven't been able to find out what it is. Any help is really appreciated.

This is on OS X 10.11. I already tried both

sudo chown -R `whoami` /usr/local/lib/node_modules

and

sudo chown -R `whoami` /usr/local

But still no luck.

like image 202
Juan José Castro Avatar asked Feb 08 '26 03:02

Juan José Castro


1 Answers

Symlink Issues could really be an issue.

For me, the shortcut was to turn it off by running the installation wihout symlink options like this below:

npm install --no-bin-links
like image 144
Akintunde Avatar answered Feb 12 '26 04:02

Akintunde



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!