Search code examples
linuxnode.jsexpressnpmlinux-mint

npm install -Error /npm/optimist/0.3.7' - Linux Mint


I'm new to node and npm, I'm running npm install on Linux MINT and the error I'm getting is this one:

Linux 3.11.0-12-generic npm ERR! argv "node" "/usr/local/bin/npm" "install" npm ERR! node v0.10.35 npm ERR! npm v2.1.17 npm ERR! path /home/rolando/.npm/optimist/0.3.7 npm ERR! code EACCES npm ERR! errno 3

npm ERR! Error: EACCES, mkdir '/home/rolando/.npm/optimist/0.3.7' npm ERR! { [Error: EACCES, mkdir '/home/rolando/.npm/optimist/0.3.7'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/home/rolando/.npm/optimist/0.3.7', npm ERR! parent: 'uglify-js' } npm ERR! npm ERR! Please try running this command again as root/Administrator.


One thing a notice is that I have the optimist 0.6.1 on my machine (not the 0.3.7), how can I fix that?? I already run an update with curl -L https://www.npmjs.org/install.sh | sh

My node -v is 0.10.35 , the npm is 2.1.17

Also If I run npm cache clean then I will get following:

Error: EACCES, unlink '/home/rolando/.npm/async/0.2.10' npm ERR! { [Error: EACCES, unlink '/home/rolando/.npm/async/0.2.10'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/home/rolando/.npm/async/0.2.10' }



Solution

  • One of the contributors of npm gave me the answer on the github forum, it was something to do with the permission like you said Victor

    sudo chown -R whoami ~/.npm