I have installed Ubuntu Bash on Windows. I already have nodejs
and npm
on my windows machine at C:\\Program Files\\nodejs
. In the bash she
I had the same problem. This is what I did.
Step 1. Type node -v
and npm -v
commands in Windows PowerShell and check if node and npm are properly installed
Step 2. Add this to the ~/.zshrc
or ~/.bashrc
file
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Step 3. type source ~/.zshrc
and/or source ~/.bashrc
Step 4. Type node -v
and npm -v
commands in bash
or zsh
shells and the correct versions should now appear
Hope this solves your problem. Peace! ✌