Skip to content

Instantly share code, notes, and snippets.

@GitHub30
Last active May 5, 2019 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GitHub30/7cf453bb5be9a451e415f11986b85c67 to your computer and use it in GitHub Desktop.
Save GitHub30/7cf453bb5be9a451e415f11986b85c67 to your computer and use it in GitHub Desktop.
# https://nodejs.org/ja/download/package-manager/#debian-and-ubuntu-based-linux-distributions-enterprise-linux-fedora-and-snap-packages
# https://github.com/nodesource/distributions/blob/master/README.md
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - \
&& sudo apt-get install -y nodejs \
&& 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.list \
&& sudo apt-get update \
&& sudo apt-get install -y yarn \
&& echo 'PATH="$HOME/.yarn/bin:$PATH"' >> ~/.profile \
&& source ~/.profile
curl -fsSL https://raw.githubusercontent.com/nodejs/docker-node/master/12/alpine/Dockerfile | sed -e '/^FROM /d' -e 's/^ENV \(\S*\) /\1=/g' -e 's/^RUN //g' -e '/^CMD /d' -e '/ #/d' > install_node_npm_yarn_for_pwd.sh \
&& time bash install_node_npm_yarn_for_pwd.sh
# Prevent PATH parameter-expantions.
cat <<'EOF' >> profile
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.yarn/bin" ] ; then
PATH="$HOME/.yarn/bin:$PATH"
fi
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment