Skip to content

Instantly share code, notes, and snippets.

@monsteronfire
Last active January 14, 2016 09:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monsteronfire/adcfd633aa78cfb72c60 to your computer and use it in GitHub Desktop.
Save monsteronfire/adcfd633aa78cfb72c60 to your computer and use it in GitHub Desktop.
node-and-npm-no-sudo (reference: https://gist.github.com/isaacs/579814)
#installing node in a custom directory so you don't have to use sudo all the time
#npm now comes with node, so no need to individually install it
cd ~
mkdir local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.zshrc
. ~/.zshrc
cd local
#download latest Source Code from https://nodejs.org/en/download/
#unzip folder and paste folder in /local directory
#rename folder (remove version number) to "node"
#cd into the node folder
cd node
#configure the prefix for the local folder you created
#remember to change the path to your actual path
./configure --prefix=/Users/yourusernamehere/local
make install
cd ..
#check node and npm versions to make sure they installed correctly
node -v
npm -v
@jwarnox
Copy link

jwarnox commented Apr 15, 2015

ran this and got:

Jamies-iMac:ok jhw$ node -v
-bash: node: command not found
Jamies-iMac:ok jhw$ npm -v
-bash: npm: command not found

the local directory was empty? was node supposed to symlink it's ~ directory into there?

Thanks,
Jamie

@monsteronfire
Copy link
Author

Hi Jamie,

"command not found" -- did you add the PATH to your .bash_profile or .zshrc or .bashrc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment