Wednesday, January 18, 2017

Installing Node 6.9.4 LTS & Latest NPM Version On Fedora 25

10:11 AM Posted by xa1
Today I spent quite sometime trying to install Latest NPM version and NodeJs LTS version 6.9.4 on Fedora 25 and it's not as easy as you think.

Following official docs didn't work. Dnf installed an older version and I got strange errors when trying to update npm to the latest version

  sudo npm install -g npm 

I ended up installing  Node like this

  sudo dnf install --enablerepo rawhide nodejs libuv --best --allowerasing 

That installed Node LTS successfully but not NPM, and I still got weird errors when trying to upgrade NPM.

so I ended up removing node-modules folder

  sudo rm -rf /usr/lib/node_modules 

and installed NPM as root

 sudo curl -L | sh

Now NPM works as correctly, version 4.1.1 installed. I'm going to try yarn once it matures, I hate NPM. Hopefully that post helps someone.