3

我正在尝试在我的 macbook 中安装 phonegap,但我不断收到此错误:

sudo npm install -g phonegap
npm ERR! Error: Cannot find module 'readable-stream'
npm ERR!     at Function._resolveFilename (module.js:337:11)
npm ERR!     at Function._load (module.js:279:25)
npm ERR!     at Module.require (module.js:359:17)
npm ERR!     at require (module.js:375:17)
npm ERR!     at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/sha/index.js:3:48)
npm ERR!     at Module._compile (module.js:446:26)
npm ERR!     at Object..js (module.js:464:10)
npm ERR!     at Module.load (module.js:353:31)
npm ERR!     at Function._load (module.js:311:12)
npm ERR!     at Module.require (module.js:359:17)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Darwin 11.4.2
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "phonegap"
npm ERR! cwd /Users/mycomputer/Desktop/test/static/game
npm ERR! node -v v0.6.18
npm ERR! npm -v 1.3.5
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mycomputer/Desktop/test/static/game/npm-debug.log
npm ERR! not ok code undefined
npm ERR! not ok code 1

我需要做什么才能安装它?

非常感谢

附言:

我已经尝试过这个解决方案,但它根本不起作用:https://github.com/isaacs/npm/issues/3698

4

1 回答 1

0

像这样从 tar.gz 文件安装怎么样: Phonegap 安装错误(npm)

它说你可以像下面这样安装:

npm install -g path/to/archive/phonegap-cli-master.tar.gz
于 2015-01-16T09:20:02.490 回答