咨询一个前端 Vue3 中集成 Electron 问题

查看 54|回复 2
作者:chenxishen   
我本地的 Node 版本,16.2.0
首先执行,cnpm i @vue/cli -g
cnpm i electrion -g
然后 vue create electron-demo, 选择的是 vue3
创建完之后,进入 electron-demo 文件夹,再执行 vue add electron-builder ,这里选择的是 Electron 13.0.0 版本,然后就报错了, 上面命令都是管理员执行的,我试了好几个版本的 node 都不行,然后各种搜报错原因,都没找到解决办法,不知道啥情况,求大神指点
npm ERR! code 1
npm ERR! path C:\Users\Administrator\Desktop\Demo\vue-electron\electron-demo\node_modules\electron
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! RequestError: certificate has expired
npm ERR! at ClientRequest. (C:\Users\Administrator\Desktop\Demo\vue-electron\electron-demo\node_modules\got\source\request-as-event-emitter.js:178:14)
npm ERR! at Object.onceWrapper (node:events:472:26)
npm ERR! at ClientRequest.emit (node:events:377:35)
npm ERR! at ClientRequest.origin.emit (C:\Users\Administrator\Desktop\Demo\vue-electron\electron-demo\node_modules\@szmarczak\http-timer\source\index.js:37:11)
npm ERR! at TLSSocket.socketErrorListener (node:_http_client:447:9)
npm ERR! at TLSSocket.emit (node:events:365:28)
npm ERR! at emitErrorNT (node:internal/streams/destroy:193:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:158:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2024-01-31T08_23_49_643Z-debug.log
ERROR Error: command failed: npm install --loglevel error --legacy-peer-deps
Error: command failed: npm install --loglevel error --legacy-peer-deps
at ChildProcess. (D:\nvm\nvm\v16.2.0\node_modules\@vue\cli\lib\util\executeCommand.js:138:16)
at ChildProcess.emit (node:events:365:28)
at ChildProcess.cp.emit (D:\nvm\nvm\v16.2.0\node_modules\@vue\cli\node_modules\.store\[email protected]\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1067:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

npm, err, Node, error

hellodigua   
https://github.com/electron/electron/issues/41133
chenxishen
OP
  
@hellodigua 感谢大佬,一下就解决了
您需要登录后才可以回帖 登录 | 立即注册

返回顶部