0

For some reason, after I restart Terminal, I won't be able to execute node anymore. Trying so results in the following error:

-bash: node: command not found

I tried removing node and reinstalling it. That works, but as soon as I restart Terminal, the magic is lost.

How can this be?

Kriem
  • 8,666
  • 16
  • 72
  • 120

1 Answers1

3

could the magic involve setting the PATH variable so node would be on the path if so then add the magic to your .bashrc?

Dan D.
  • 73,243
  • 15
  • 104
  • 123
  • Sorry about the delay. Had a meeting. This is what my `.bashrc` says: `export PATH=$HOME/local/bin:$PATH` Looks normal, right? Still, no magic. – Kriem Jul 22 '11 at 07:46
  • what i meant was that the installation of node changed the `PATH` to include its location. so when `node` works what is the result of `echo $PATH` and `which node`? – Dan D. Jul 22 '11 at 08:06
  • `echo PATH` says `/Users/karimmaassen/local/bin:/Users/karimmaassen/local/bin:/Users/karimmaassen/local/node/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin` I installed node 4.10 – Kriem Jul 22 '11 at 09:02
  • you should add `export PATH=$HOME/​local/node/bin:$PATH` to `.bashrc` – Dan D. Jul 22 '11 at 09:20
  • I did. Doesn't seem to fix it. EDIT: I did, now it fixes it. :) Thanks for the help!! – Kriem Jul 22 '11 at 09:29
  • It appears to be in the .profile where things got messy, by the way. – Kriem Jul 22 '11 at 09:44