12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sudoなのにElectronがPermission Deniedでインストールできない問題を直す

Last updated at Posted at 2018-03-06

2017年後半から一部の環境でこの問題が発生しているようです。

環境

OS: Antergos
Kernel: x86_64 Linux 4.15.6-1-ARCH
~ ❯❯❯ node -v // -> v8.9.4

問題

>>> sudo npm install -g electron
/// ~~~~~ ///

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.8.3 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@1.8.3 postinstall script.

解決

sudo npm install -g electron --unsafe-perm=true --allow-root

参考

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron' · Issue #17268 · npm/npm - github

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?