isaacs/npm — Issue #1864: Install error on Linux Mint 12
Author: stevenspasbo
Created: 2011-12-09 17:44:36+00:00
State: open

I installed node and npm using apt, after trying to install less using npm it threw some errors so I removed npm and tried to install manually but got this:

$ curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7184 100 7184 0 0 16993 0 --:--:-- --:--:-- --:--:-- 43539
tar=/bin/tar
version:
tar (GNU tar) 1.25
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz
0.6.2
1.0.106
cleanup prefix=/usr
find: `/usr/lib/node': No such file or directory
find: `/usr/lib/node': No such file or directory

All clean!
npm ERR! Could not create /usr/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.106 Error: EACCES, permission denied '/usr/lib/node_modules'
npm ERR! Error: EACCES, permission denied '/usr/lib/node_modules'
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.0.0-12-generic
npm ERR! command "/usr/bin/node" "/tmp/npm.18823/package/cli.js" "install" "-gf"
npm ERR! cwd /tmp/npm.18823/package
npm ERR! node -v v0.6.2
npm ERR! npm -v 1.0.106
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /tmp/npm.18823/package/npm-debug.log
npm not ok
It failed

I assume because I installed node using the package manager it was trying to install it as root, I tried to sudo it as well but that didn't work either. After removing node using apt I was able to get it to work by installing it manually. I'm not sure if this will do you any good but it told me to report the issue.