【问题标题】:vue add electron-builder: Manual workaround?vue 添加电子生成器:手动解决方法?
【发布时间】:2022-11-10 13:50:52
【问题描述】:

我正在关注 Vue.js 3 By Example (John Au-Yeung) 一书。 在第 4 章中,任务是使用 Vue CLI Plugin Electron Builder 创建一个项目。 在创建标准 vue 项目后,我做了以下操作:

vue add electron-builder

我得到以下错误:

npm ERR! code 1
npm ERR! path C:\data\projects\chap4\node_modules\electron-chromedriver
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./download-chromedriver.js
npm ERR! node:internal/process/promises:279
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR!
npm ERR! GotError [RequestError]: self signed certificate in certificate chain
npm ERR!     at ClientRequest.<anonymous> (C:\data\projects\chap4\node_modules\got\source\request-as-event-emitter.js:178:14)
npm ERR!     at Object.onceWrapper (node:events:642:26)
npm ERR!     at ClientRequest.emit (node:events:539:35)
npm ERR!     at ClientRequest.origin.emit (C:\data\projects\chap4\node_modules\@szmarczak\http-timer\source\index.js:37:11)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:454:9)
npm ERR!     at TLSSocket.emit (node:events:527:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:122:3)

当我在公司发行的PC上运行它时,我知道它与下载文件的一些限制有关。

我可以手动下载 chromedriver 以绕过错误吗? 我不知道怎么做。 感谢您的输入

【问题讨论】:

    标签: node.js electron-builder


    【解决方案1】:

    对我有用的是为安装添加 ELECTRON_GET_USE_PROXY=true,这是一个带有“npm”的例子: npx cross-env ELECTRON_GET_USE_PROXY=true npm install electron-builder

    'vue'应该有类似的东西

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-09-25
      • 2017-06-13
      • 1970-01-01
      • 2020-05-25
      • 2017-07-31
      • 1970-01-01
      • 2018-11-25
      • 2017-09-05
      相关资源
      最近更新 更多