Electron failed to install correctly, please delete node_modules/electron and try installing again

  • Post author:
  • Post category:其他




报错说明

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

已经有啦

在这里插入图片描述



最后执行启动项目,没有报错啦



版权声明:本文为qq2523208472原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。