Electron 7.x以上版本安裝提示錯誤解決方法


升級使用最新的Electron 7.x以上版本,運行提示electron不存在,其實是因為electron install時候對應平台的可執行文件沒有下載成功,錯誤提示如下:

(node:18000) UnhandledPromiseRejectionWarning: Error: EPERM: operation not permitted, lstat 'C:\Users\JUNCHU~1\AppData\Local\Temp\electron-download-4VfCX9\electron-v7.1.7-win32-x64.zip'
(node:18000) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:18000) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm WARN smartoffice@0.1.47 No repository field.

在官方的Git Issues找到了解決方案,就是修改使用另一個淘寶鏡像地址。執行命令:

npm config set ELECTRON_MIRROR=https://cdn.npm.taobao.org/dist/electron/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM