Macos – Unable to install nvm on mac OSX – documentation appears to be innacurate

macosnode.js

So as per the documentation on https://www.npmjs.org/package/nvm installation consists of two steps. The first step is

$ npm install -g nvm

, the second step

export PATH=./node_modules/.bin:$PATH

The second step is inaccurate, I do not have any folders called node_modules created after running the command.
I figured the /usr/local/bin/nvm or /usr/local/lib/node_modules/nvm/bin/nvm that appeared in my terminal have a file somewhere I need to add to the PATH but I am not sure which. When I go directly to /usr/local/bin/nvm and execute ./nvm lsI get a message saying "local" not implemented yet.

This is what my terminal looks like:

Juans-MacBook-Pro:thefuck juan$ sudo npm install -g nvm
Password:
/usr/local/bin/nvm -> /usr/local/lib/node_modules/nvm/bin/nvm
nvm@0.0.3 /usr/local/lib/node_modules/nvm
└── mkdirp@0.3.5
Juans-MacBook-Pro:thefuck juan$ ls
Juans-MacBook-Pro:thefuck juan$ 

I ran out of ideas of what I can do to successfully install npm & am now turning to the community for help.

Best Answer

you need also do:

 git clone git://github.com/creationix/nvm.git ~/.nvm
 printf "\n\n# NVM\nif [ -s ~/.nvm/nvm.sh ]; then\n\tNVM_DIR=~/.nvm\n\tsource ~/.nvm/nvm.sh\nfi" >> ~/.bashrc
 NVM_DIR=~/.nvm
 source ~/.nvm/nvm.sh

All the details you could want are here: http://www.backdrifter.com/2011/02/18/using-nvm-and-npm-to-manage-node-js/

Related Question