2

How can this happen?

    jon@vaio:~/brickify$ /usr/bin/node -v
    v0.8.11
    jon@vaio:~/brickify$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    jon@vaio:~/brickify$ node -v
    jon@vaio:~/brickify$

/usr/bin is in $PATH, so just writing node -v should work the same as writing /usr/bin/node -v

  • 2
    Does node exist in any other folder on the path? – nanofarad Oct 12 '12 at 23:52
  • 1
    which node will show you the path of the binary that's actually running when you do node without an absolute path. Like ObsessiveFOSS says, it's likely there's another node in the directories before /usr/bin. – roadmr Oct 13 '12 at 00:24
  • 1
    Is that dollar sign at the end of your path really there, or was it some sort of typo? It shouldn't actually be there, but if it is, it may cause problems with your path. – Marty Fried Oct 13 '12 at 01:31
  • 1
    @ObsessiveSSO: yes, it also exists in /usr/sbin... When I run /usr/sbin/node -v I get the same lack of output as when I run node -v. So that explains. But, why the node installation chose to set things up this way, still puzzles me. But that's another question. @roadmr: which node points to /usr/bin @MartyFried: The dollar sign was a typo –  Oct 14 '12 at 11:12

2 Answers2

1

You can see which version of a program is being invoked by using the which command, e.g.

which node
0
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games$

You have to remove the $ sign from end oth the PATH value