Problemi di autorizzazione Installazione di NPM su OSX
Domanda
Ho problemi di installazione del pacchetto nodo "NPM".
Sul sito web Ti chiede di eseguire un'installazione a 1 riga come segue ...
curl http://npmjs.org/install.sh | sh
Questo sputa il seguente errore di installazione ...
$ 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 27012 0 --:--:-- --:--:-- --:--:-- 39256
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz
0.4.11
1.0.106
cleanup prefix=/usr
All clean!
npm ERR! Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "/usr/bin/node" "/private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package/cli.js" "rm" "npm" "-gf"
npm ERR! cwd /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.106
npm ERR! path /usr/bin/npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package/npm-debug.log
npm not ok
npm ERR! error installing npm@1.0.106 Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! error rolling back npm@1.0.106 Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "/usr/bin/node" "/private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.106
npm ERR! path /usr/bin/npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.72890/package/npm-debug.log
npm not ok
Dopo Google in giro Sembrava che questo fosse un problema comune e il modo di risolverlo è semplicemente eseguire lo stesso comando prefisso con sudo.
Stranamente, questo non sembra funzionare nel mio caso. Questo è quello che succede se eseguo lo stesso comando sudo'd.
$ sudo curl http://npmjs.org/install.sh | sh
Password:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7184 100 7184 0 0 9974 0 --:--:-- --:--:-- --:--:-- 40359
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz
0.4.11
1.0.106
cleanup prefix=/usr
All clean!
npm ERR! Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "/usr/bin/node" "/private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package/cli.js" "rm" "npm" "-gf"
npm ERR! cwd /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.106
npm ERR! path /usr/bin/npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package/npm-debug.log
npm not ok
npm ERR! error installing npm@1.0.106 Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! error rolling back npm@1.0.106 Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Error: EACCES, Permission denied '/usr/bin/npm'
npm ERR! Report this *entire* log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "/usr/bin/node" "/private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.106
npm ERR! path /usr/bin/npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/var/folders/mn/8q6c34bj67xbxk08dwlsb_y40000gn/T/npm.81519/package/npm-debug.log
npm not ok
It failed
Sto disegnando uno spazio vuoto qui. Qualche idea?
Soluzione
curl http://npmjs.org/install.sh | sudo sh
È sh
Ciò ha bisogno delle autorizzazioni, non curl
.
Altri suggerimenti
Questo ha funzionato per me
git clone http://github.com/isaacs/npm.git
cd npm
sudo make install
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow