gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-31 22:24:05 24 4
gpt4 key购买 nike

我无法更新 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com