Install Node.js and Yarn

Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine. It could used to create front-end project easily. Yarn is a fast dependency management tool. npm is great, but yarn could make the management better.

Install Node

Key Link: https://nodejs.org/en/download/

Node.js is kind of tricky, it has quite a lot of versions, and the compatibility is kind of terrible. Besides, it provides binary release.

Let’s take the current LTS v8.12.0 for example.

Going to the download page, and choose LTS->Linux Binaries (x86/x64)->64bit. The download link for right now is https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz.

Decompress it using command:

$ tar -xJf node-v8.12.0-linux-x64.tar.xz

We could get a folder. Make a symbolic link from node-v8.12.0-linux-x64/bin/ to somewhere in you $PATH*. Or just add it in your PATH

Install Yarn

Key Link: https://yarnpkg.com/en/docs/install

Yarn is much stabler, we can just follow the instruction and install it step by step.

Note:

We may NOT install Node.js here. If we are using Ubuntu,

$ sudo apt-get update
$ # sudo apt-get install yarn # DON'T USE THIS
$ sudo apt-get install --no-install-recommends yarn