Skip to content

Instantly share code, notes, and snippets.

@jeffschwartz
Created December 7, 2018 22:49
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 jeffschwartz/aa807d4c2499ca0251659c498a9fc252 to your computer and use it in GitHub Desktop.
Save jeffschwartz/aa807d4c2499ca0251659c498a9fc252 to your computer and use it in GitHub Desktop.
install node without sudo and use without sudo on Linux
#!/bin/bash
VERSION=v10.1.14
DISTRO=linux-x64
mkdir ~/local
mkdir ~/local/lib
mkdir ~/local/lib/nodejs
tar -xJvf ~/Downloads/node-$VERSION-$DISTRO.tar.xz -C ~/local/lib/nodejs
mv ~/local/lib/nodejs/node-$VERSION-$DISTRO ~/local/lib/nodejs/node-$VERSION
How to use install-node.sh
1. download node installation *.tar/xz to the ~/Downloads folder
2. open a terminal
3. using Vim or Neovim, open the above script and set VERSION and DISTRO appropriately for the version of Node you are installing and save the file and exit the editor
4. from the command line, run the script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment