4
0

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.

Mac に electron をインストールするとき Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron' が出る

Last updated at Posted at 2017-10-16

electron のインストールがうまくいかない

Mac (もしかすると他でも)で、
以下の環境で electron のインストールにはまったのでメモ

  • 追記 npm install xx -g するときの問題でした。

$ node -v
v7.8.0
$ npm -v
n5.5.1

インストールしようとした electron 1.7.9

$ sudo npm install electron -g
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron/cli.js

> electron@1.7.9 postinstall /usr/local/lib/node_modules/electron
> node install.js

/usr/local/lib/node_modules/electron/install.js:48
  throw err
  ^

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

やったこと

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

参考
https://github.com/npm/npm/issues/17268

4
0
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
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?