【IDE】vscode 调试electron main代码时,报错:App threw an error during load

错误信息如下:

App threw an error during load 
Error: Cannot find module 'E:\0000_code\xxx\xxx-project\xxx-app\--inspect-brk=20226' 
    at Module._resolveFilename (internal/modules/cjs/loader.js:602:15) 
    at Function.Module._resolveFilename (E:\0000_code\xxx\xxx-project\xxx-app\node_modules\electron-prebuilt-compile\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12) 
    at Function.Module._load (internal/modules/cjs/loader.js:528:25) 
    at Module.require (internal/modules/cjs/loader.js:658:17) 
    at init (E:\0000_code\xxx\xxx-project\xxx-app\node_modules\electron-compile\lib\config-parser.js:294:16) 
    at main (E:\0000_code\xxx\xxx-project\xxx-app\node_modules\electron-prebuilt-compile\lib\es6-init.js:58:29) 
    at Object. (E:\0000_code\xxx\xxx-project\xxx-app\node_modules\electron-prebuilt-compile\lib\es6-init.js:61:1) 
    at Object. (E:\0000_code\xxx\xxx-project\xxx-app\node_modules\electron-prebuilt-compile\lib\es6-init.js:63:3) 
    at Module._compile (internal/modules/cjs/loader.js:711:30) 
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) 

发现是electron版本造成的。有问题的版本是^3.0.0,修改为~3.1.0后修复。可能是需要3.1.x以上版本

你可能感兴趣的:(Web大前端)