ソースからNode.js v.0.10.20をインストールしました。ターゲットボックス Ubuntu 12.04.3 LTS。ノードはエラーなしで正常にインストールされています。結局のところ、それは次のようです:
node -v
v0.10.20
npm -v
1.3.11
しかし、 -g モジュールをリストするだけで、理解できない奇妙なメッセージが表示されます。
esa@fingolfin:~$ npm list -g
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/normalize-package-data requires semver@'1.x' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 2.1.0
-g リストの一番下に、さらにメッセージが表示されます。
npm ERR! invalid: semver@2.1.0 /usr/local/lib/node_modules/npm/node_modules/semver
npm ERR! extraneous: normalize-package-data@0.1.7 /usr/local/lib/node_modules/npm/node_modules/normalize-package-data
npm ERR! not ok code 0
また、 npm@1.3.11 -module の下に次の行が表示されます。
│ ├── semver@2.1.0 invalid
私の記憶が正しければ、以前のノード バージョン (0.10.18) でも同じことが起こります。
解決できない迷惑なメッセージ。私はsemver-moduleを手動でインストールしていないと確信しており、インストールされたノードモジュールのどれもsemverを使用していないことを確信しています。
編集:Nirkのおかげで、npmを再インストールするとこれが解決します。確かに、私はsudo su -を与え、ルートとして再インストールしました。たぶん、sudo :ing だけでも機能します。
これが私がしたことです:
sudo su -
root@fingolfin:~# curl https://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7882 100 7882 0 0 13118 0 --:--:-- --:--:-- --:--:-- 23669
tar=/bin/tar
version:
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
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.
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-1.3.11.tgz
0.10.20
1.3.11
cleanup prefix=/usr/local
All clean!
unbuild npm@1.3.11
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@1.3.11 /usr/local/lib/node_modules/npm
It worked
root@fingolfin:~#
URL がhttps://npmjs.org/install.shに移動したことに注意してください。