您好,登錄后才能下訂單哦!
想全局安裝electron卻提示我沒有權限:
sudo npm install -g electron
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/electron-tmp-download-1374-1511880539207'
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.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/pomelo/.npm/_logs/2017-11-28T14_49_00_758Z-debug.log
這就很奇怪了,去electron的github的issue里找到了解決辦法,需要把npm相關的目錄的權限轉移到當前用戶來:
官方解決:https://docs.npmjs.com/getting-started/fixing-npm-permissions
之后安裝會卡在node install.js
這里,需要換國內的鏡像,編輯/.npmrc:
electron_mirror=https://npm.taobao.org/mirrors/electron/
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。