在Mac上安装remotebuild失败,“uid必须是unsigned int”

时间:2016-10-07 06:58:51

标签: node.js macos cordova visual-studio-2015 npm

我曾尝试在Mac上安装remotebuild,以便通过我的Mac在Visual Studio 2015中部署Cordova应用程序。

技术信息: macOS Sierra 节点v4.6.0 npm v3.10.8 xcode 8

但它失败并出现以下错误:“uid必须是unsigned int”

我尝试重新安装npm但没有成功。

$ sudo npm install -g remotebuild

npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "remotebuild"
npm ERR! node v4.6.0
npm ERR! npm  v3.10.8

npm ERR! uid must be an unsigned int
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "remotebuild"
npm ERR! node v4.6.0
npm ERR! npm  v3.10.8
....
npm ERR! uid must be an unsigned int
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

2 个答案:

答案 0 :(得分:1)

  

但它失败并出现以下错误:“uid必须是unsigned int”

这是一个已知问题,根本原因在于Node.js核心,其中OS X上的UID nobody-2转换为无符号整数,将是由fs.stat()以有符号整数形式返回。请参阅Github here中的讨论。此问题仅存在于npm v3.10.8

修复程序已更新。请参阅fs: fix handling of struct stat fields #8515

答案 1 :(得分:0)

这将通过将节点模块的权限重置为您的ID来解决此问题:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

对于记录,这种情况会发生在使用nom安装许多不同的问题,例如安装Cordova:

npm install -g cordova