Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 1.1 KB

config.md

File metadata and controls

56 lines (40 loc) · 1.1 KB

Install nodejs ^16.0.0

You may need to remove old versions of nodejs.

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* ~/.npm
sudo rm -rf /usr/local/lib/node*
sudo rm -rf /usr/local/bin/node*
sudo rm -rf /usr/local/include/node*

sudo apt-get purge nodejs npm
sudo apt autoremove

Dowload the latest binary from the official nodejs site.

tar -xf node-v#.#.#-linux-x64.tar.xz
sudo mv node-v#.#.#-linux-x64/bin/* /usr/local/bin/
sudo mv node-v#.#.#-linux-x64/lib/node_modules/ /usr/local/lib/

Verify your installation.

node -v
npm -v

Install yarn

npm install --global yarn
yarn --version

Optional Building libs

sudo apt-get update
sudo apt-get install libtool gcc g++ make

Increase the Max Memory for Node

To avoid the FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory run the following command:

export NODE_OPTIONS="--max-old-space-size=8192"

Or to make it permanent:

echo "export NODE_OPTIONS=\"--max-old-space-size=8192\"" >> ~/.bashrc