0
我試圖在OS X Sierra上用npm在全局安裝電子模塊。當我運行NPM無法安裝模塊,權限被mkdir拒絕
sudo npm install electron -g
我得到
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron/cli.js
> [email protected] 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/dist'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ianwise/.npm/_logs/2017-08-10T22_16_42_927Z-debug.log
這個問題似乎在NPM運行的mkdir將一個權限被拒絕......但是我使用sudo運行此,那麼,爲什麼這是一個問題?
在先進的感謝
selinux是否妨礙了您的工作? –
@BobVale我不熟悉selinux,對不起,有沒有辦法可以檢查? –
對不起錯過的osx部分不認爲它有它。 –