解决npm安装electron总失败的问题

add electron --save-dev --registry=https:/registry.npm.taobao.org
npm ERR! code 1
npm ERR! path C:\Users\xxxxxxxxx\app\node_modules\electron
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node install.js
npm ERR! RequestError: unable to verify the first certificate
npm ERR!     at ClientRequest.<anonymous> (C:\Users\xxxxxxxxx\app\node_modules\got\dist\source\core\index.js:970:111)
npm ERR!     at Object.onceWrapper (node:events:628:26)
npm ERR!     at ClientRequest.emit (node:events:525:35)
npm ERR!     at origin.emit (C:\Users\xxxxxxxxx\app\node_modules\@szarczak\http-timer\dist\source\index.js:43:20)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:502:9)
npm ERR!     at TLSSocket.emit (node:events:513:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!     at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
npm ERR!     at TLSSocket.emit (node:events:513:28)
npm ERR!     at TLSSocket._finishInit (node:_tls_wrap:959:8)
npm ERR!     at ssl.onhandshakedone (node:_tls_wrap:743:12)

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxxxxxx\AppData\Local\npm-cache\_logs\2023-10-18T08_03_12_856Z-debug-0.log

百度和谷歌搜索,各种换源加代理都没解决。 最后找到了https://npmmirror.com/这个网站,根据指导,安装定制的cnpm管理工具npm install -g cnpm --registry=https://registry.npmmirror.com

然后执行cnpm install –save-dev electron 成功了。

相关推荐

  1. 解决npm安装electron失败问题

    2024-01-21 06:58:04       37 阅读
  2. electron-builder构建生产安装包下载失败问题

    2024-01-21 06:58:04       34 阅读
  3. 如何解决无法npm下载electron依赖

    2024-01-21 06:58:04       28 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-21 06:58:04       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-21 06:58:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-21 06:58:04       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-21 06:58:04       20 阅读

热门阅读

  1. 阿里云GPU服务器ECS实例规格详细说明

    2024-01-21 06:58:04       42 阅读
  2. 如何在阿里云ECS服务器中搭建gpt-index

    2024-01-21 06:58:04       37 阅读
  3. Webpack5入门到原理25:总结

    2024-01-21 06:58:04       35 阅读
  4. ubuntu下通过ssh在两台计算机之间拷贝文件

    2024-01-21 06:58:04       27 阅读
  5. RHCE--Linux--网站需求

    2024-01-21 06:58:04       36 阅读
  6. TCP协议

    TCP协议

    2024-01-21 06:58:04      33 阅读
  7. Redis(01)——常用指令

    2024-01-21 06:58:04       34 阅读
  8. linux切换root用户su - root和su root的区别

    2024-01-21 06:58:04       29 阅读
  9. vue.config.js中打包相关配置

    2024-01-21 06:58:04       34 阅读