I added zsh to my terminal in VSCode and installed nvm.
But every time I open the terminal in vs code, it must re-run
source ~/.nvm/nvm.sh
If not, it will throw an error:
nvm not found and node not found
how to fix it :((
I added zsh to my terminal in VSCode and installed nvm.
But every time I open the terminal in vs code, it must re-run
source ~/.nvm/nvm.sh
If not, it will throw an error:
nvm not found and node not found
how to fix it :((
3
Answers
The NVM install script should edit your
.zshrc
to add the following:This will
source
the required file needed for NVM to work properly.If you installed NVM by hand, you’ll need to place that into your
.zshrc
(or.bashrc
) yourself.For more information, please see the installing and updating guide.
In my
.zshrc
I have following lines:This works for me on Ubuntu Linux.
t sounds like the issue is that your terminal isn’t automatically sourcing your NVM (Node Version Manager) configuration when you open it. This typically happens because the startup files for your shell are not correctly sourcing the necessary NVM script.
As a workaraound, add the following line in your ~/.bashrc file
After adding the above line, you’ll need to restart your terminal.