Many others have encountered a similar issue, but I'm struggling to resolve it.
Every time I open VSCode, I find myself needing to run these commands in the terminal for npx, npm, and nvm to work:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
I also added these commands to my .zsh_profile and included
"terminal.integrated.shellArgs.linux": "-L",
in my settings.json located at Library/Application Support/Code/User/settings.json.
Even after restarting VSCode, npm, nvm, and npx are still not functioning.
View image here for referenceUpon switching back to the bash terminal profile in VSCode, surprisingly everything works; however, other commands like ls
and find
result in errors, making it challenging to use bash in the VSCode terminal.
Any recommendations on what steps I should take next?