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

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

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
Categories: Code

Yu

Ideals are like the stars: we never reach them, but like the mariners of the sea, we chart our course by them.

Leave a Reply

Your email address will not be published. Required fields are marked *