Node.js
Installation on Ubuntu (18.04/16.04)#
## the following line is not needed for Ubuntu 18.04 as the dependencies are installed already# sudo apt-get install curl python-software-propertiescurl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -sudo apt-get install nodejsTo verify version 12 has been installed successfully:
node -v npm -vInstall yarn package manager#
NOTE: Many have said yarn is no longer relevant, as it no longer has much advantages over Node.js https://yarnpkg.com/lang/en/docs/install/#debian-stable
curl -sL 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.listsudo apt-get update && sudo apt-get install yarn
history below
Fix npm Global Install Permissions#
First check, where npm point to, if you call:
npm config get prefix
If /usr is returned, you can do the following:
mkdir ~/.npm-globalexport NPM_CONFIG_PREFIX=~/.npm-globalexport PATH=$PATH:~/.npm-global/binTo make it permanent, add the export items in the .bashrc