vscode: Launch extension debugger failed
When launch extension debugger, it fails with the following message:
Error: Cannot find module 'c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\spdlog\build\Debug\spdlog.node'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Function.t._load (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:814:682)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\bindings\bindings.js:81:44)
at Object.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\spdlog\index.js:3:35)
at Object.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\spdlog\index.js:21:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (13 by maintainers)
@joaomoreno I don’t understand this issue either.
Here is all you need to know about
.asar.unpackedin two sentences. When creating an.asar, it is possible to leave some files unpacked. In this case, the.asaronly contains the file name and the file stats, but the contents are left on disk in a sibling folder.asar.unpacked.For example, if somebody wants to open
bla.asar/foo/bar.txtand the file was left unpacked, then the contents are read frombla.asar.unpacked/foo/bar.txt. But please note that everything after the asar name must be the same!The error message in https://github.com/Microsoft/vscode/issues/55993#issuecomment-413552939 complains about a certain path:
c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\spdlog\build\spdlog.nodeand the Windows Explorer screenshot shows a different path:
C:\Program Files\Microsoft VS Code\resources\app\node_modules.asar.unpacked\spdlog\build\Release\spdlog.nodePlease look carefully at the paths and observe that:
\spdlog\build\spdlog.nodeis not equal to\spdlog\build\Release\spdlog.node.So the error message is valid,
c:\Program Files\Microsoft VS Code\resources\app\node_modules.asar\spdlog\build\spdlog.nodecan not be found.Why is
spdloglooking for its native node module at the wrong path? We ship other native node modules which look for their respective.nodefile at the correct location. Take a look here for example. I think it is possible to look for one’s dll at the right location.@joaomoreno You posed a question asking @liwangqian to look for a file that does not exist on any machine.
node_modules.asaris a file on disk, it is not a folder that can contain a subfolder calledspdlog.spdlogforReleaseand not forDebug.I was trying to help out but it looks like I’ve just confused everybody.