3

阅读他们建议通过 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 安装没问题。

4

1 回答 1

1

看起来这是节点版本 0.10.14 的问题,但已修复为 0.10.15,如下所示:https ://github.com/isaacs/npm/issues/3703

于 2013-07-26T00:17:41.827 回答