在Mac OS X上通过npm安装phonegap时出错

时间:2013-07-26 00:09:27

标签: cordova npm

阅读他们建议使用commnad:

通过npm安装phonegap的phonegap文档
sudo npm install -g phonegap

但是我在控制台>

中收到以下错误
MacBook-Pro:$ sudo npm install -g phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http 304 https://registry.npmjs.org/phonegap
npm ERR! TypeError: uid must be an unsigned int
npm ERR!     at Object.fs.chown (fs.js:853:11)
npm ERR!     at Object.chown (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:131:17)
npm ERR!     at endChown (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:212:12)
npm ERR!     at setProps (/usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:295:5)
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/fstream/lib/writer.js:286:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
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 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "phonegap"
npm ERR! cwd /Users/mark
npm ERR! node -v v0.10.14
npm ERR! npm -v 1.3.5
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mark/npm-debug.log
npm ERR! not ok code 0

观看npm-debug.log会显示其他信息:

43 info postuninstall phonegap@3.0.0-0.14.0
44 verbose tar unpack /Users/mark/.npm/phonegap/3.0.0-0.14.0/package.tgz
45 silly lockFile f38db7ac--local-lib-node-modules-phonegap tar:///usr/local/lib/node_modules/phonegap
46 verbose lock tar:///usr/local/lib/node_modules/phonegap /Users/mark/.npm/f38db7ac--local-lib-node-modules-phonegap.lock
47 silly lockFile 97de6b36-honegap-3-0-0-0-14-0-package-tgz tar:///Users/mark/.npm/phonegap/3.0.0-0.14.0/package.tgz
48 verbose lock tar:///Users/mark/.npm/phonegap/3.0.0-0.14.0/package.tgz /Users/mark/.npm/97de6b36-honegap-3-0-0-0-14-0-package-tgz.lock
49 silly gunzTarPerm modes [ '755', '644' ]
50 silly gunzTarPerm extractEntry package.json
51 silly gunzTarPerm extractEntry .npmignore
52 silly gunzTarPerm extractEntry README.md
53 error TypeError: uid must be an unsigned int
53 error     at Object.fs.chown (fs.js:853:11)

当我尝试使用此机制安装cordova cli时,我得到了非常相似的输出。 我不知道我做错了什么,因为我已经通过npm成功安装了其他软件包,例如express和socket.io,没有任何问题,所以我假设我的node.js安装没问题。

1 个答案:

答案 0 :(得分:1)

看起来这是节点版本0.10.14的一个问题,但固定在0.10.15,如下所示:https://github.com/isaacs/npm/issues/3703