This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
install-scripts/dev-setup/node.sh

22 lines
677 B
Bash
Raw Normal View History

2020-03-19 21:44:26 +00:00
#!/bin/sh
set -e
if command -v apt-get ; then
apt-get -y install gnupg
else
echo "Error - no package installer found."
exit 1
fi
cd /tmp
wget https://nodejs.org/dist/"$_node_version"/node-"$_node_version"-"$_node_distro".tar.xz
sudo mkdir -p /usr/local/lib/nodejs
tar -xJvf node-"$_node_version"-"$_node_distro".tar.xz -C /usr/local/lib/nodejs
echo "PATH=/usr/local/lib/nodejs/node-$_node_version-$_node_distro/bin:$PATH" >> /home/"$_user"/.profile
curl -sS 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.list
apt-get update && sudo apt-get -y install yarn