[英]Node.js install module on windows
Cmd錯誤:“sh”未被識別為內部或外部命令,可操作程序或批處理文件。
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.
擴展弗洛里安的答案:你在Windows上,沒有cURL
或sh
。 您正在嘗試安裝依賴於提供libcurl-library和sh
操作系統的模塊,該模塊不隨Windows一起提供。
你有一些選擇:
編寫自己的節點實現,其行為類似於curl。
在SO上看到這個問題: nodejs中的卷曲等價物? 它詳細介紹了如何使用內置的http
模塊,如curl。
或者使用像cygwin這樣的工具在windows上安裝libcurl
和sh
。 我沒有試過這個,你嘗試安裝的npm模塊可能仍然依賴於cygwin無法解決的其他unix工具。
或者在http://search.npmjs.org/中尋找與curl相似的其他內容。 嘗試httpsync
或curly
我推薦選項1,它會教你基本的http原則。 節點中的本機模塊已經提供了您可能需要卷曲的所有內容。 :)
好吧,在沒有curl的窗口上使用node-curl是非常愚蠢的。
別試試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.