尝试在 Mac 上安装 npm 时出现奇怪的错误

发布于 2024-11-26 15:26:58 字数 5093 浏览 0 评论 0原文

当尝试使用 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$ 

When trying to install npm on mac os x 10.6.6 with Xcode 3.2 I get the following error. How can I resolve this?

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$ 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

鸩远一方 2024-12-03 15:26:58

听起来您正在运行旧版本的节点。最新的 npm 需要 Node v0.4 及更高版本。

It sounds like you are running an older version of node. The latest npm requires node v0.4 and higher.

本宫微胖 2024-12-03 15:26:58

似乎有点倒退,因为您在尝试安装软件包时缺少软件包。

解决方法可能是手动安装 Gracefull-fs
https://github.com/isaacs/node-graceful-fs

Seems a little backwards as you are missing a package when trying to install the package.

A work around might be manually installing gracefull-fs
https://github.com/isaacs/node-graceful-fs

云裳 2024-12-03 15:26:58

我建议您使用以下软件包安装 Node 和 npm:https://sites.google.com/site/nodejsmacosx /

这样你就可以确保 node 和 npm 匹配。

卸载当前的 Nodejs 版本可能是个好主意。

I recommend you installing node and npm with these packages: https://sites.google.com/site/nodejsmacosx/

That way you make sure node and npm matches.

Uninstalling your current nodejs version might be a good idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文