volta
volta copied to clipboard
cannot set breakpoint when debugging in a node addon project
The reproduction steps are as follows:
- Use Volta to install the latest version of node@22 or node@20. I only tried these two versions.
- Run
npm install -g node-gyp. - Open a project that uses a Node addon, such as https://github.com/yantze/demo-nodejs-addon-debug
- Run npm run rebuild:dev.
- Set a breakpoint in
src/hello.ccusing VSCode, for example, at line 16. Then start debugging and notice that the breakpoint is not hit.
However, this issue does not occur when I use Node installed via NVM. I have no clue why this is happening.