2

I've been all over looking for a solution. I've read that I should purge both node and nodejs, do a fresh installation then link the two together. This did not work. I was told to try nodejs legacy. This did not work.

I am trying to install something that requires a newer version of node. My nodejs has upgraded just fine, but node, unfortunately, has not.

node -v
v5.4.1

nodejs -v
v8.**** (latest)

I can't be the only person who is experiencing this. Does anyone have a fix? Running Ubuntu 16.04

fappycow@fappycow-desktop:~$ type -a node nodejs 
node is /home/fappycow/.nvm/versions/node/v5.4.1/bin/node 
node is /usr/local/bin/node 
node is /usr/bin/node 
nodejs is /usr/bin/nodejs 
2
  • 1
    Output of type -a node nodejs, please.
    – muru
    Jun 19, 2017 at 5:29
  • fappycow@fappycow-desktop:~$ type -a node nodejs node is /home/fappycow/.nvm/versions/node/v5.4.1/bin/node node is /usr/local/bin/node node is /usr/bin/node nodejs is /usr/bin/nodejs Jun 19, 2017 at 5:33

1 Answer 1

2

The problem here is that node has been installed with nvm. Whenever you want to upgrade to the latest version of node, just run nvm install node.

I would also uninstall nodejs: sudo apt purge nodejs

Using nvm is much better than the nodejs binary.

7
  • How tf do you guys just know this? I've seriously been searching and searching. I saw a nvm solution but they were saying you had to cd into a location(which I didnt have) and then purge it and then reinstall it with make etc. Thank you for this! I hope it helps someone else too Jun 19, 2017 at 5:40
  • I had heaps of problems installing node until I found nvm. BTW: If this answer helped you click the tick next to it to mark it as the correct answer. It will give us both more reputation.
    – user689314
    Jun 19, 2017 at 5:42
  • What is crazy though is I opened another terminal and typed in node -v and I got the previous version again which messed up the next step in my installation process for solidity. Jun 19, 2017 at 5:53
  • Check it out its wild I have no idea whats going on here: imgur.com/a/9obZ7 Jun 19, 2017 at 6:02
  • An answer to the first screenshot. nvm can only be run by your own user. sudo runs it as the root user. You should never have to run nvm as root.
    – user689314
    Jun 19, 2017 at 9:15

You must log in to answer this question.

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