I am unable to install npm on cygwin. I have installed node v0.4.12 which is supposed to be the last supported version of nodejs on cygwin.
Here is the error I get :
curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 85 0 85 0 0 344 0 --:--:-- --:--:-- --:--:-- 904
sh: line 1: syntax error near unexpected token `newline'
sh: line 1: `<html>Moved: <a href="https://npmjs.org/install.sh">https://npmjs.org/install.sh</a>'
Please help me fix this. TIA.
The error is because that URL responds with a 302 redirect. You'll need to use a different URL, which just has a different protocol -- https vs. http.
curl https://npmjs.org/install.sh | sh
Though, as I noted in a comment above, you can install Node 0.8 or later on Windows without cygwin.
Sorry - late to the game, but this worked for me:
curl https://www.npmjs.org/install.sh | sh
Now the url is be https://www.npmjs.org/install.sh.
So the complete installation command is:
curl https://www.npmjs.org/install.sh | sh
This might change again in the future. Refer to the official gist for many installation options of node and npm, or this guide on joyent blog.