I'm looking at my $PATH


And noting that last directory is not a directory. I'm guessing it should look like


instead of


and that something went wrong with a node.js installation at some point.

So I look at my .bash_profile:



and I THINK I should correct the file to reflect the above change and run source ~.bash_profile

Am I right?

  • You have posted .bash_profile so that we see line wraps where there are none. I'm afraid to edit it because the source looks like export is on a separate line, which is a different error, but also an error. Could you update to show the precise contents of this file as a code block, please? – tripleee Feb 15 '17 at 12:55
  • That is the code block -- and there is a line break between the lines PATH and export, even now, in the working file adjusted according to grgarside's solution. My $PATH variable is complete with both sets of directories listed above so I can't see how export on a separate line twould be an error. – brianfit Feb 16 '17 at 9:10
  • Have a look at this screen dump: i.stack.imgur.com/iMiTu.png -- using > instead of a four-line indent marks your text as an excerpt, not as a code block, and that means it's reflown to my screen width. – tripleee Feb 16 '17 at 9:14
  • Gotcha. Four line indented now. – brianfit Mar 1 '17 at 10:50
  • So you really do have the export statements on separate lines? That would produce a huge amount of declare -x output on your terminal when you log in. (There should be no need to export PATH explicitly because it is already exported. If you want NPM_PATH to be exported, you need to move the export to the beginning of the line where you assign it.) – tripleee Mar 1 '17 at 11:22

Your fix is missing a forward slash before Users, therefore …tools:/Users/gpiuser/.npm/bin.

It seems …tools:$HOME/.npm/bin was what was intended, but stating the literal path works too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .