VUE添加电子构建器:手动解决方法?

发布于 2025-02-12 11:59:42 字数 1336 浏览 2 评论 0原文

我以身作则(John Au-Yeung)遵循Vue.js 3的书。 在Chap4中,任务是使用Vue CLI插件电子构建器创建一个项目。 在创建标准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以通过错误吗? 我不知道如何。 感谢您的输入

I'm following the book Vue.js 3 By Example (John Au-Yeung).
In chap4, the task is Creating a project with Vue CLI Plugin Electron Builder.
I did below after the standard vue project was created:

vue add electron-builder

And I got below error:

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)

As I ran it in a company issued PC, I know it's related to some restrictions of download files.

Can i download the chromedriver manually to by pass the error?
I have no idea how.
Apprecaite your input

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴骨ら 2025-02-19 11:59:42

对我有用的东西是添加electron_get_use_proxy = True为安装,这是一个具有'npm'的示例:

npx cross-env ELECTRON_GET_USE_PROXY=true npm install electron-builder

与'vue'有类似的东西

Something that worked for me was to add ELECTRON_GET_USE_PROXY=true for the install, this is an example with 'npm':

npx cross-env ELECTRON_GET_USE_PROXY=true npm install electron-builder

There should be something similar with 'vue'

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文