- Get node binary (node.exe) from http://nodejs.org/download/
- Create the folder where node will reside and move node.exe to it
- Download the last zip version of npm from http://nodejs.org/dist/npm
- Unpack the zip inside the node folder
- Download the last tgz version of npm from http://nodejs.org/dist/npm
- Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
- Add the the node folder and the packages/bin folder to PATH
- On a command prompt execute
npm install -g npm
to update npm to the latest version
Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.
These days you just go to https://nodejs.org/en/download/ and download the binary zip - it has the proper npm version.
Instead of modifying PATH globally, there should be a way to modify it for your node session only.
For example, I have been using the following approach to run custom Java and Python environments:
I think it should be possible to use a similar approach for nodejs, modifying PATH for the current session. And, of course, modifying the global paths also to prevent npm from polluting your OS with cached library files.