安裝全局包時報錯,之前已經遇到過,結果第二次又忘記解決方法,果然還是要記下來,好記性不如爛筆頭哇
$ npm i electron -g
Unhandled rejection Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\node_cache\_cacache\tmp\f23044b6'
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://npm.community>
這個錯誤是因為沒有管理員權限,解決方法,右鍵點擊開始菜單,選擇以管理員身份運行,在打開的黑窗再繼續安裝就可以

OK,安裝成功

