Я пытаюсь установить npm с помощью сценария оболочки на Mac 10.6.4, и кажется, что sudo не работает, поскольку оболочка не работает при попытке доступа к /usr /lib и создания документов в этом каталоге. Что случилось?
fred:echowaves fred$ sudo curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3927 100 3927 0 0 3702 0 0:00:01 0:00:01 --:--:-- 6975
fetching: http://registry.npmjs.org/npm/-/npm-1.0.22.tgz
0.4.10
1.0.22
prefix=/usr
This script will find and eliminate any shims, symbolic
links, and other cruft that was installed by npm 0.x.
Is this OK? enter 'yes' or 'no'
es
Is this OK? enter 'yes' or 'no'
yes
All clean!
! [ -d .git ] || git submodule update --init --recursive
node cli.js cache clean
node cli.js rm npm -g -f --loglevel error
node cli.js install -g -f
npm ERR! Could not create /usr/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.22 Error: EACCES, Permission denied '/usr/lib/node_modules/___npm.npm'
npm ERR! Error: EACCES, Permission denied '/usr/lib/node_modules/___npm.npm'
npm ERR!
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR!
npm ERR! sudo npm "install" "-g" "-f"
npm ERR!
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR!
npm ERR! npm config set unsafe-perm true
npm ERR!
npm ERR! System Darwin 11.0.0
npm ERR! command "node" "/private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package/cli.js" "install" "-g" "-f"
npm ERR! cwd /private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package
npm ERR! node -v v0.4.10
npm ERR! npm -v 1.0.22
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package/npm-debug.log
npm not ok
make: *** [install] Error 13
npm ERR! Could not create /usr/lib/node_modules/___npm.npm
npm ERR! error installing npm@1.0.22 Error: EACCES, Permission denied '/usr/lib/node_modules/___npm.npm'
npm ERR! Error: EACCES, Permission denied '/usr/lib/node_modules/___npm.npm'
npm ERR!
npm ERR! Please use 'sudo' or log in as root to run this command.
npm ERR!
npm ERR! sudo npm "install" "-gf"
npm ERR!
npm ERR! or set the 'unsafe-perm' config var to true.
npm ERR!
npm ERR! npm config set unsafe-perm true
npm ERR!
npm ERR! System Darwin 11.0.0
npm ERR! command "/usr/bin/node" "/private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package
npm ERR! node -v v0.4.10
npm ERR! npm -v 1.0.22
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/lf/7q2cr83j2nvdvp266pg6p0180000gn/T/npm.64068/package/npm-debug.log
npm not ok
It failed
fred:echowaves fred$