Apologies for leading you in the wrong direction with this answer originally.
After installing nvm
again in a test WSL session (I usually use n
myself) I see that Linux nvm
is installed as a bash function, not as a binary. This means that whereis nvm
doesn't actually see it, since whereis
only looks for files.
> type nvm | head -1
nvm is a function
Two things to note:
When entered without a fully-qualified path (absolute or relative), the function will take precedence over a binary. So as long as type nvm
returns the function, you should be fine.
And the fact that you mention (in the comments) that your path starts with /home/seefer/.nvm/versions/node/v14.18.0/bin
means that the Linux nvm
is working correctly and prepending the correctly activate directory to your path.
If you are experiencing issues with node
or npm
after using the nvm use
or nvm install
commands, let us know.
While whereis nvm
finds /mnt/c/Users/seefe/AppData/Roaming/nvm/nvm.exe
, you would have to actually run nvm.exe
for it to run the Windows version.
There is one more thing to watch out for here, though, that is related to that other answer.
npm
on Windows is a strange one, since it actually does ship with a shell script (even though it is for Windows) named npm
that in turn calls the Windows npm.exe
. If you have Windows Node/NPM installed (and it sounds like you do), be careful that you always active the Linux version (so that it is prepended to the path) with the Linux nvm.
Otherwise you can get into issues with Windows npm
trying to run under WSL/Linux.
Be careful with this. As long as you have activated a node/npm installation with the Linux