- 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
- Key Link: https://yarnpkg.com/en/docs/install
Yarn is much stabler, we can just follow the instruction and install it step by step.
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