22 lines
677 B
Bash
22 lines
677 B
Bash
|
#!/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
|