I use cygwin on windows 8.1 to have an Unix shell. But I cannot run commands such as npm from it.
What should I do to do it? Add some kind of env var to cygwin? Why
This seems to be a problem with the npm script as mentioned here, https://github.com/joyent/node/issues/5912
Assuming you have installed nodejs in the default location you can run the following dos2unix command and fix the error.
dos2unix c:/Program\ Files/nodejs/npm
This fixed my problems with the npm script.