4

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.
newpdv
  • 412
  • 1
  • 6
  • 15

2 Answers2

5

To expand on Florian's answer: You're on Windows, which doesn't have cURL or sh. You're trying to install a module that relies on your operating system offering the libcurl-library and sh, which is not shipped with Windows.

You have some options:

  1. 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 http module, like curl.

  2. Or install libcurl and sh on 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.

  3. Or look for something else in http://search.npmjs.org/ that behaves like curl. Try httpsync or curly

I recommend option 1, it'll teach you basic http principles. The native modules in node already offer everything you might need curl for. :)

Community
  • 1
  • 1
rdrey
  • 9,379
  • 4
  • 40
  • 52
  • Curl's homepage has generic binaries for both Win32 and Win64. Generic sh clones are widely available. – ebohlman Jul 24 '12 at 14:25
  • I don't know whether those help... the problem is either that @newpdv wants to install a node module and it fails, or that (s)he wants to use cURL from node. Javascript-only implementations (using built-in modules) might be nicer than calling curl in a subprocess. – rdrey Jul 25 '12 at 07:30
-4

Well, using node-curl on windows, that doesn't have curl, is quite stupid.

Don't try.

Florian Margaine
  • 58,730
  • 15
  • 91
  • 116
  • Ok. How easy use cookie on http.request? – newpdv Jul 24 '12 at 13:14
  • 4
    to be fair, node-curl could be a node.js implementation of the curl command line tool, it's not immediately obvious from the name that it wraps a native implementation of curl. – rdrey Jul 24 '12 at 13:36