Electron安装报错问题(6.0.3)

因近期需要给团队科普一下electron框架知识,所以把之前的安装的版本卸载掉重装,卸掉就出问题了,半天装不上。报错信息如下:

Error: Failed to find Electron v6.0.3 for win32-x64 at https://cdn.npm.taobao.org/dist/electron/6.0.3/electron-v6.0.3-win32-x64.zip
    at Request. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\electron\node_modules\[email protected]@nugget\index.js:169:61)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at Request.onRequestResponse (C:\Users\Administrator\AppData\Roaming\npm\node_modules\electron\node_modules\[email protected]@request\request.js:1066:10)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:558:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
    at TLSSocket.socketOnData (_http_client.js:454:20)
    at emitOne (events.js:116:13)
[npminstall:runscript:error] [email protected] scripts.postinstall run "node install.js" error: Error: Run "C:\WINDOWS\system32\cmd.exe /d /s /c node install.js" error, exit code 1
Install fail! Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node install.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node install.js" error, exit code 1
    at ChildProcess.proc.on.code (C:\Users\Administrator\AppData\Roaming\npm\node_modules\cnpm\node_modules\runscript\index.js:74:21)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

关键信息:

Error: Failed to find Electron v6.0.3 for win32-x64 at https://cdn.npm.taobao.org/dist/electron/6.0.3/electron-v6.0.3-win32-x64.zip

https://cdn.npm.taobao.org/dist/electron/6.0.3/electron-v6.0.1-win32-x64.zip - 无效的链接

在浏览器打开这个链接可以看到确实是个无效资源,尝试修改链接手动切换到之前的版本:

https://cdn.npm.taobao.org/dist/electron/6.0.1/electron-v6.0.1-win32-x64.zip - 可以正常访问

可以确定6.0.1版本是正常的,使用如下命令安装6.0.1版本即可:

cnpm i -g [email protected]

搞定,收工。

你可能感兴趣的:(Electron安装报错问题(6.0.3))