不能在全球范围内安装电子

时间:2018-08-27 04:35:23

标签: ubuntu npm electron

我正在尝试在全球范围内安装电子设备,但是我遇到了这个令人讨厌的错误消息


/home/tbh/.npm-global/bin/electron -> /home/tbh/.npm-global/lib/node_modules/electron/cli.js

> electron@2.0.8 postinstall /home/tbh/.npm-global/lib/node_modules/electron
> node install.js

/home/tbh/.npm-global/lib/node_modules/electron/install.js:54
  throw err
  ^

Error: EACCES: permission denied, mkdir '/home/tbh/.npm-global/lib/node_modules/electron/dist'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@2.0.8 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@2.0.8 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我已经尝试了几件事,包括使用sudo运行它,以及更改了Stackoverflow上针对此问题的NPM配置 但是对我没有用 如果有人需要此问题的日志,可以在这里here找到它 PS:我的操作系统是Ubuntu 18.04

1 个答案:

答案 0 :(得分:2)

尝试使用以下方式安装:scale=

来源:https://github.com/electron/electron/issues/10604#issuecomment-333368230