問題: electron啟動報錯
Electron failed to install correctly, please delete node_modules/electron and try installing again
解決思路:參考github
- 在 node_modules\electron 文件夾下創(chuàng)建文件path.txt
- 在path.txt文件中寫入內(nèi)容 electron.exe文件夾(windows系統(tǒng)水评,其他系統(tǒng)參考代碼)
- 手動下載electron 包功蜓,淘寶鏡像下載安裝包
- 把3下載的zip包解壓縮到 node_modules\electron\dist
問題:electron在國內(nèi)npm安裝緩慢
解決思路:
- Linux: $XDG_CACHE_HOME or ~/.cache/electron/
- MacOS: ~/Library/Caches/electron/
- Windows: %LOCALAPPDATA%/electron/Cache or ~/AppData/Local/electron/Cache/
- 再執(zhí)行npm install時會自動檢測到安裝包