V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
chenxishen
V2EX  ›  问与答

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

  •  
  •   chenxishen · 316 天前 · 854 次点击
    这是一个创建于 316 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我本地的 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.<anonymous> (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.<anonymous> (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)
    2 条回复    2024-01-31 16:50:21 +08:00
    chenxishen
        2
    chenxishen  
    OP
       316 天前
    @hellodigua 感谢大佬,一下就解决了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1657 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 16:29 · PVG 00:29 · LAX 08:29 · JFK 11:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.