I just updated to 20.04 and every time I open a terminal /usr/bin/env: ‘node’: No such file or directory
shows at the very top. I have searched for answers but in the questions I found, npm did not work. It works for me though. I have no clue where to look or what to do.
1 Answer
If you used NVM for your node and npm, this may help:
nodepath=$(which node); sudo ln -s $nodepath /usr/bin/node
NVM installs it somewhere out of the norm, so creating this link solved my issue.
You can run the command which node
in your terminal to see where NVM installed it if you're curious.
-
When I get
failed to create symbolic link '/usr/bin/node': File exists
. Node is in/home/.nvm/versions/node/v15.0.1/bin/node
. I don't know if that says anything. Nov 12, 2020 at 20:01 -
That's fine. Mine is:
/home/william/.nvm/versions/node/v14.15.0/bin/node
Did you try running that command? Nov 13, 2020 at 21:35 -
Ok, I made it work, but I am not sure why. I removed my node version and installed the LTS instead and then I overwrote using the flag -f (thanks to Alexander Glulkhovtsev Nov 15, 2020 at 14:15
-