Cmd error: “sh” is not recognized as an internal or external command, operable program or batch file.
C:\Users\user>npm install -g node-curl
npm http GET https://registry.npmjs.org/node-curl
npm http 304 https://registry.npmjs.org/node-curl
> node-curl@0.1.4 install C:\Users\user\AppData\Roaming\npm\node_modules\node-cu
rl
> sh src/generate_curl_options_list.sh && node-waf configure build || true
"sh" is not recognized as an internal or external command, operable program or batch file.
"true" is not recognized as an internal or external command, operable program or batch file.
To expand on Florian’s answer: You’re on Windows, which doesn’t have
cURLorsh. You’re trying to install a module that relies on your operating system offering the libcurl-library andsh, which is not shipped with Windows.You have some options:
Write your own node-only implementation that behaves like curl.
See this question on SO: Curl equivalent in nodejs?
It goes into details of how to use the built-in
httpmodule, like curl.Or install
libcurlandshon windows, with a tool like cygwin. I haven’t tried this, and the npm module you’re trying to install might still have dependencies on other unix tools that aren’t solved by cygwin.Or look for something else in http://search.npmjs.org/ that behaves like curl. Try
httpsyncorcurlyI recommend option 1, it’ll teach you basic http principles. The native modules in node already offer everything you might need curl for. 🙂