【问题标题】:can't install electron globally无法全局安装电子
【发布时间】:2019-02-01 14:19:25
【问题描述】:

我正在尝试全局安装电子,但我遇到了这个烦人的错误消息


/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 运行它并更改 NPM 配置以在 Stackoverflow 上对这个问题进行认证 但没有什么对我有用 如果有人需要这个问题的日志,你可以在这里找到它here PS:我的操作系统是 Ubuntu 18.04

【问题讨论】:

  • 你试过sudo npm install -g electron

标签: ubuntu npm electron


【解决方案1】:

尝试安装:sudo npm install -g electron --unsafe-perm=true --allow-root

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

【讨论】:

  • 没问题 :),总是乐于提供帮助
猜你喜欢
  • 2014-04-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-23
  • 2015-03-25
  • 1970-01-01
相关资源
最近更新 更多