-2

I have set the environment $PATH in the .bashrc file for node and npm to be in /home/username/bin/. When i check with which node for instance it points in the right place, that being /home/username/bin/node , YET when i try to node -v or node i get the bash: /usr/bin/node: No such file or directory (the main location) so it does not get over it.

What can i do to set the priorities of them binaries?

Deck Pope
  • 231
  • 3
  • 10
  • Does this answer your question? [How to prioritize one executable in PATH over the other that has the same name and is in a different PATH file](https://stackoverflow.com/questions/33966080/how-to-prioritize-one-executable-in-path-over-the-other-that-has-the-same-name-a) – tripleee Mar 09 '22 at 09:55

1 Answers1

0

First when i restarted .bashrc was that issue rising, the second time when i restarted .bashrc with source ~/.bashrc it was working. If there can be another option i will leave it open.

Thanks

Deck Pope
  • 231
  • 3
  • 10
  • please rephrase, its very confusing – piyushj May 24 '16 at 11:35
  • only after two restartings of the `.bashrc` file using `source ~/.bashrc` it worked. – Deck Pope May 24 '16 at 13:00
  • 2
    I bet you did not **check** the PATH variable. If you just `echo $PATH` you get the PATH order in the **current shell session**. It is just that, an order of directories that the shell walks left to right to find your binary. – grochmal May 24 '16 at 17:29