Skip to content

Instantly share code, notes, and snippets.

@danpetrv
Last active June 10, 2019 07:39
Show Gist options
  • Save danpetrv/e3c14d2f8c7f20ee371c0def504d9f79 to your computer and use it in GitHub Desktop.
Save danpetrv/e3c14d2f8c7f20ee371c0def504d9f79 to your computer and use it in GitHub Desktop.

The apt-get version of node is incredibly old, and installing a new copy is a bit of a runaround.

So here's how you can use NVM to quickly get a fresh copy of Node on your new Bash on Windows install

$ touch ~/.bashrc
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
// restart bash
$ nvm install node

Then on macOS you should do:

touch ~/.bash_profile

and add this source ~/.bashrc to your .bash_profile file

Once you've done that you'll get a nice:

$ node --version
$ v7.4.0

install yarn

Note: Ubuntu 17.04 comes with cmdtest installed by default. If you’re getting errors from installing yarn, you may want to run

sudo apt remove cmdtest

On Debian or Ubuntu Linux, you can install Yarn via our Debian package repository. You will first need to configure the repository:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Then, to install yarn after nvm run:

sudo apt-get update && sudo apt-get install --no-install-recommends yarn

more about Yarn installation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment