node.js - 我无法用 npm 更新 electron

标签 node.js npm electron

我无法更新 electron-prebuilt。 我多次执行 sudo npm update electron-prebuilt -g

但是,尽管使用了 sudo,但每次都会出现权限被拒绝的错误。

为什么我无法成功更新electron?

iojs3.2.0, OS X 10.10.5

错误日志如下

/usr/local/lib/node_modules/electron-prebuilt/install.js:15
  throw err
  ^

Error: EACCES: permission denied, rename '/usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-818-1441021602097/electron-v0.31.1-darwin-x64.zip' -> '/Users/user_name/.electron/electron-v0.31.1-darwin-x64.zip'
at Error (native)
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "install" "electron-prebuilt" "-g"
npm ERR! node v3.2.0
npm ERR! npm  v2.14.1
npm ERR! code ELIFECYCLE

npm ERR! electron-prebuilt@0.31.1 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron-prebuilt@0.31.1 postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/lib/node_modules/npm-debug.log

最佳答案

此问题报告于 https://github.com/mafintosh/electron-prebuilt/issues/48解决方法似乎是首先在没有 -g 标志的情况下安装,这将首先将文件放入用户文件夹,然后使用 -g 再次安装。

编辑:我猜不知何故权限搞砸了,我正在执行 chmod。似乎如果我 chmod 不仅为用户自己而且为 groupothers 工作。也许其他人也可以尝试一下?

关于node.js - 我无法用 npm 更新 electron,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32311095/

相关文章:

node.js - 如何将静态文件添加到 Electron 应用程序

node.js - Twilio Node.js API 日期格式

node.js - 来自私有(private) github 存储库的 npm 包,安装与更新 (package.json)

javascript - npm 在哪里安装包?

node.js - NodeJS : How to stop a web server?

electron - 在Windows 10 ElectronJS任务栏中显示托盘

node.js - 如何让 EC2 上的 Node.js 服务器永远运行?

vpn - 带 MS-CHAPv2 说明的 RADIUS

javascript - 在重新启动和关闭之前,通过 API 调用在 Electron 中处理操作系统重新启动和关闭

node.js - 无法使用任何已安装的 npm 软件包 : Not Recognized