Categories
Blog

Installing Node.js and NPM on Windows Subsystem Linux

UPDATE

Original Post

Today I ran through quite a bit of trouble getting the most current version of nodejs and npm installed in my Ubuntu 16 (on windows 10). It turns out, the normal way of using apt-get to install it, installs a pretty old version. The workaround, I found on a github gist here.
$ touch ~/.bashrc
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
// restart bash
$ nvm install node
It’s a simple curl command that will download and run a bash script that will install NVM (Node Version Manager), and then you use NVM to install the latest and greatest node and npm. Here is the actual github page for nvm itself, if you’re curious:
https://github.com/creationix/nvm/blob/master/README.md As of writing this article, this worked for me, and I was able to proceed working on my angular project originally started on my Macbook Pro.