electronのインストールを実行して失敗する。
sudo npm install electron-prebuilt -g
/usr/local/lib/node_modules/electron-prebuilt/install.js:15
throw err
^
Error: EACCES, rename '/usr/local/lib/node_modules/electron-prebuilt/electron-tmp-download-3875-1440596181526/electron-v0.30.6-darwin-x64.zip'
at Error (native)
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "electron-prebuilt"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! electron-prebuilt@0.30.6 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron-prebuilt@0.30.6 postinstall script 'node install.js'.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
node install.jsでエラーになっている。パーミッションの問題?
対応方法は下記参照
https://github.com/mafintosh/electron-prebuilt/issues/27
chmod 777 ~/.electron
mkdir test
cd test
npm init # use default values
npm i electron-prebuilt
cd node_modules/electron-prebuilt
sudo npm link
これでelectronコマンド実行出来るようになった。
ただ-gオプションつけてないのでグローバルでインストール出来てないかもしれないので一次対応として考える。