I run "sudo npm install yui3", errors is #191, I run "ulimit -n 64",and try again ,but the errors still exist. I run "npm help install", the info is :
kaven:nodejs-yui3 kaven$ npm help install
npm it worked if it ends with ok
npm cli [ 'help', 'install' ]
npm version 0.1.26
npm config file /Users/kaven/.npmrc
npm config file /usr/local/etc/npmrc
npm ! ERROR !
npm ! ERROR ! Error: Failed to make /usr/local/lib/node/.npm/.tmp while ensuring /usr/local/lib/node/.npm/.tmp
npm ! ERROR ! EACCES, Permission denied '/usr/local/lib/node/.npm/.tmp'
npm ! ERROR ! at MKDIRCB (/usr/local/lib/node/.npm/npm/0.1.26/package/lib/utils/mkdir-p.js:30:29)
npm ! ERROR ! at node.js:764:9
npm ! ERROR !
npm failure try running: 'npm help help'
npm failure Report this entire log at http://github.com/isaacs/npm/issues
npm failure or email it to firstname.lastname@example.org
npm not ok
If you use sudo with npm, you need to use sudo with npm all the time.
Don't use sudo. Do this instead:
sudo chown -R $USER /usr/local/
and then never use sudo again with npm.
Yes, I see , thank you.
It helped! Thanks!
I still find this a very problematic issue:
@isaacs : I have tried your solution: http://foohack.com/2010/08/intro-to-npm/#what_no_sudo
If I now make a file manually at /usr/lib, it works, and also works for some packages.
But, npm install -g fails for some packages, which try to make a symlink (to /usr/bin I suppose). I guess there is no solution but to use sudo then, is there?