我正在尝试从vscode本身调试vscode源代码。当我尝试从“启动VS代码”调试时然后按F5,它会出现以下错误。
Loading "winreg" failed
loader.js:224
Error: Cannot find module 'winreg'
loader.js:227
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (c:\Users\oguz\Documents\workspace\vscode\.build\electron\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at nodeRequire (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1642:28)
at NodeScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:703:39)
at OnlyOnceScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:549:37)
at loadNextPath (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1401:41)
at Object.errorback (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1409:25)
Detail:
loader.js:225
Error: Cannot find module 'winreg'
loader.js:225
Here are the modules that depend on it:
Array(1) ["vs/platform/telemetry/node/workbenchCommonProperti…"]
答案 0 :(得分:0)
我找到了自己的解决方案。 Npm需要winreg
模块,但无法找到它。所以,我通过npm install winreg
命令手动安装它。现在我可以调试vscode。