I have an issue on node.js debugging on vscode, it no matter what I do persists on a particular node.js version on nvm.
lets say I have the following simple launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "webpack launch",
"program": "npx",
"args": [
"webpack",
"serve",
"--config",
"config/webpack.config.dev.js",
"--port",
"3051",
],
"autoAttachChildProcesses": true,
"stopOnEntry": true
},
note: this has been working completely fine until I recently changed nvm version mainly I use and on an other computer.
if you run the above "webpack launch" debug, in the debug console, it shows:
/home/user/.nvm/versions/node/v13.10.1/bin/node npx webpack serve --config config/webpack.config.dev.js --port 3051
well, I'm not using v13.10.1 anymore, but v17.9.0. I'm saying this for a countless times, vscode. lets do the steps I'm doing to tell vscode to not to use the old version but the v17.9.0 version:
- .bashrc
added nvm use v17.9.0
in the last line
- nvm alias default
ran nvm alias default v17.9.0
- .nvmrc
added nvm use v17.9.0
in ~/.nvmrc
- reload/re-launch vscode
reload vscode and/or quit vscode then restart vscode.
- check in the terminal
check if nvm working by checking its version on the newly opened vscode instance terminal.
$ nvm current
v17.9.0
$ node -v
v17.9.0
- re-try the debug
the same. wow.
/home/user/.nvm/versions/node/v13.10.1/bin/node npx webpack serve --config config/webpack.config.dev.js --port 3051
Process exited with code 1
What tf is going on with vscode? What am I missing here, may I know? Thanks.