LoginSignup
6
8

More than 3 years have passed since last update.

electron-rebuildを使う際にnpm -gで入れたelectronを使うには

Last updated at Posted at 2015-10-16

背景

SSDの容量も残りわずかな環境では、プロジェクト毎に

npm install electron-prebuilt

なんてやっていてはどんどんSSDを消耗する。

electron-rebuildとは

ネイティブコードを含むモジュールをelectron向けのモジュールにリビルドする便利ツール

デフォルトではelectronをプロジェクトローカルに入れたものを使おうとする。

しかし、npm -gでグローバルに入れたelectronを使うこともオプションでできるようになっていた。

nodebrew環境の場合

nodebrewを使って

npm install electron-prebuilt -g

でインストールしたelectronを使うには

./node_modules/.bin/electron-rebuild -e ~/.nodebrew/current/lib/node_modules/electron-prebuilt

関連記事

6
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
6
8