I'm getting this message upon startup, just after I login as a user. I recently installed nodejs, realized I should have researched it more and installed it LOCALLY, and subsequently went through file system and deleted everything node and npm. I've been using Ubuntu for a while, delve into the command line once in a while, but I'm only starting to get familiar with the file system, and I dont know anything about this issue. Here's what it says:

 Error found when loading /home/j/.profile:

 /home/j/.profile: line 23: export: '/home/j/.npm/bin': not a valid

 As a result the session will not be configured correctly. You should
 fix the problem as soon as feasible.

I guess this is because I purposely deleted it? TBH, I am not sure I can track down EVERYTHING I did to bungle all this, but here how the ~/.profile reads:

line 23:

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: /home/j/.npm/bin

*edit** - Sorry, I should have specified that the PATH variable part is line 23. And when I copied it for this post originally, it was late and i didn't realize it didn't paste the last part, the /home/j/.npm/bin part.

I remember updating the path variable based on something I read, (that is the path variable as I understand?) but since that folder no longer exists (rm'd all npm stuff), I'll need to change it again, and get rid of that last thing directing to /home/j/.npm/bin. I don't want to blind crack-hack anymore based on stuff I read. Plus I'm only just beginning to understand this.

Thanks anyone..? Perhaps directing to any info on the PATH and how to update/correct it?

  • ` /home/j/.profile: line 23: export: '/home/j/.npm/bin': not a valid identifier` you should look on line 23 to check the error – Maythux May 21 '15 at 5:34
  • @maythux - thanks, I edited my comment on line 23. It was late and I didn't paste it correctly originally. See above. thx – gson78 May 24 '15 at 6:19

There's a stray space in this line:

export PATH=/usr.../games: /home/j/.npm/bin

See that space after the :? Remove it.

It would be better if you used instead:

export PATH="/home/j/.npm/bin:$PATH"

Your original line completely re-writes the PATH, ignoring modifications that may have been made elsewhere.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.