报错说明
D:\ideaProjects\task-ui\node_modules\electron\index.js:17
throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
^
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (D:\ideaProjects\task-ui\node_modules\electron\index.js:17:11)
at Object.<anonymous> (D:\ideaProjects\task-ui\node_modules\electron\index.js:21:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (D:\ideaProjects\task-ui\.electron-vue\dev-runner.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
调试查看报错信息
D:\ideaProjects\task-ui\node_modules\electron\index.js:17:11)
发现electron目录下没有这个path.txt文件

进入\node_modules\electron目录

执行安装命令node install
执行完成后发现该文件path.txt已经有啦

在开发环境中,遇到 Electron 库安装错误,提示缺少 path.txt 文件。通过删除 node_modules/electron 目录并重新运行安装命令,成功解决问题。安装完成后,path.txt 文件生成,项目启动无误。

被折叠的 条评论
为什么被折叠?



