1

Xcode 3.2 を使用して mac os x 10.6.6 に npm をインストールしようとすると、次のエラーが発生します。どうすればこれを解決できますか?

MacPro:juggernaut fred$ curl http://npmjs.org/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3902  100  3902    0     0   4114      0 --:--:-- --:--:-- --:--:--  7898
fetching: http://registry.npmjs.org/npm/-/npm-1.0.22.tgz

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/read-json.js:7:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/bin/read-package-json.js:9:16)
    at Module._compile (node.js:462:23)
0.2.5

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/read-json.js:7:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/bin/read-package-json.js:9:16)
    at Module._compile (node.js:462:23)

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/read-json.js:7:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/bin/read-package-json.js:9:16)
    at Module._compile (node.js:462:23)
! [ -d .git ] || git submodule update --init --recursive
node cli.js cache clean

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/ini.js:31:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/config.js:10:11)
    at Module._compile (node.js:462:23)
make: *** [uninstall] Error 1

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/ini.js:31:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/config.js:10:11)
    at Module._compile (node.js:462:23)

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/ini.js:31:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/config.js:10:11)
    at Module._compile (node.js:462:23)

node.js:63
    throw e;
    ^
Error: Cannot find module 'graceful-fs'
    at loadModule (node.js:275:15)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/utils/ini.js:31:10)
    at Module._compile (node.js:462:23)
    at Module._loadScriptSync (node.js:469:10)
    at Module.loadSync (node.js:338:12)
    at loadModule (node.js:283:14)
    at require (node.js:411:14)
    at Object.<anonymous> (/private/var/folders/Da/DabGxbDzFA8Fcw2FWL3FpE+++TI/-Tmp-/npm.53508/package/lib/config.js:10:11)
    at Module._compile (node.js:462:23)
It failed
MacPro:juggernaut fred$ 
4

3 に答える 3

3

古いバージョンのノードを実行しているようです。最新のnpmには、ノードv0.4以降が必要です。

于 2011-08-01T17:49:12.963 に答える
0

パッケージをインストールしようとするとパッケージが見つからないため、少し逆に見えます。

回避策は、gracefull-fshttps://github.com/isaacs/node-graceful-fsを手動でインストールすることです

于 2011-07-27T03:03:25.747 に答える
0

これらのパッケージを使用してnodeとnpmをインストールすることをお勧めします:https ://sites.google.com/site/nodejsmacosx/

このようにして、nodeとnpmが一致することを確認します。

現在のnodejsバージョンをアンインストールすることをお勧めします。

于 2011-10-25T16:58:39.430 に答える