Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@jwarnox 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

This comment has been minimized.

Copy link
Owner Author

@monsteronfire monsteronfire commented Jul 18, 2015

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