Why do I need to call the npm link admin?

I installed some nodejs packages globally through

sudo npm install gulp -g

Now I (or another developer on the same computer) wants to use it in a project with

me@host:/my/project$ npm link gulp

Unable to complete

unbuild gulp@3.8.11
npm ERR! Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR!  { [Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js']
npm ERR!   errno: 50,
npm ERR!   code: 'EPERM',
npm ERR!   path: '/my/projectnode_modules/gulp/bin/gulp.js' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.2.0-4-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "link" "gulp"
npm ERR! cwd /raid5/workspaces/jgr/aktivglueck-laravel
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /my/projectnode_modules/gulp/bin/gulp.js
npm ERR! code EPERM
npm ERR! errno 50
npm ERR! stack Error: EPERM, chmod '/my/projectnode_modules/gulp/bin/gulp.js'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /my/projectnpm-debug.log
npm ERR! not ok code 0

WITH

sudo npm link gulp

everything is working fine.

What I need to know: Why do I npm linkneed administrator permissions? In my understanding, I create a link inside my project folder, where I have full permissions - so what does it do on the global system?

+4
source share
1 answer

I believe that it npm linkcreates a symbolic link to the current directory wherever the globally installed node packages are installed. See here .

( npm config get prefix), , .

sudo /, .

+2

All Articles