问答详情
源自:3-2 Electron告白程序(一)

安装electorn 抛出异常,求解

http://img1.mukewang.com/5e4a534c00018e4413370725.jpg

(node:2584) UnhandledPromiseRejectionWarning: HTTPError: Response code 404 (Not Found) for https://cdn.npm.taobao.org/dist/electron/v8.0.1/electron-v8.0.1-win32-x64.zip
    at EventEmitter.<anonymous> (D:\Programme\node-v12.14.1\node_global\node_modules\electron\node_modules\_got@9.6.0@got\source\as-stream.js:35:24)
    at EventEmitter.emit (events.js:223:5)
    at module.exports (D:\Programme\node-v12.14.1\node_global\node_modules\electron\node_modules\_got@9.6.0@got\source\get-response.js:22:10)
    at ClientRequest.handleResponse (D:\Programme\node-v12.14.1\node_global\node_modules\electron\node_modules\_got@9.6.0@got\source\request-as-event-emitter.js:155:5)
    at Object.onceWrapper (events.js:313:26)
    at ClientRequest.emit (events.js:228:7)
    at ClientRequest.origin.emit (D:\Programme\node-v12.14.1\node_global\node_modules\electron\node_modules\_@szmarczak_http-timer@1.1.2@@szmarczak\http-timer\source\index.js:37:11)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
    at TLSSocket.socketOnData (_http_client.js:456:22)
(node:2584) 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:2584) [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.

提问者:XiaoShan_2016 2020-02-17 16:50

个回答

  • XiaoShan_2016
    2020-02-18 01:11:40

    在命令后面加上版本号即可以解决:cnpm install -g electron@5.0.6