install node.js and yarn
This commit is contained in:
parent
46124691f4
commit
9571ade0c1
|
@ -1,2 +1,5 @@
|
||||||
export _url="hugo-skeleton.home"
|
export _url="hugo-skeleton.home"
|
||||||
export _user='ray'
|
export _user='ray'
|
||||||
|
|
||||||
|
export _node_version=v12.16.1
|
||||||
|
export _node_distro=linux-x64
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/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
|
Reference in New Issue