gpt4 book ai didi

node.js - 从 cmd 运行 cordova 时出现 npm http GET 错误

转载 作者:太空宇宙 更新时间:2023-11-04 02:28:17 24 4
gpt4 key购买 nike

当我在 Mac 上运行 cordova platform add iOS 时,出现以下错误:

npm http GET https://registry.npmjs.org/cordova-ios/3.8.0
TypeError: Request path contains unescaped characters.
at new ClientRequest (_http_client.js:73:11)
at TunnelingAgent.exports.request (http.js:49:10)
at TunnelingAgent.createSocket (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
at TunnelingAgent.addRequest (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
at new ClientRequest (_http_client.js:154:16)
at Object.exports.request (http.js:49:10)
at Object.exports.request (https.js:136:15)
at Request.start (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:594:30)
at Request.end (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/request/index.js:1186:28)

我尝试通过尝试以下所有方法来设置我的代理,但似乎没有任何效果:

    npm config set registry http://registry.npmjs.org/
npm config set proxy http://myusername:mypassword@proxy.us.somecompany:8080
npm config set https-proxy http://myusername:mypassword@proxy.us.somecompany:8080
npm config set strict-ssl false
set HTTPS_PROXY=http://myusername:mypassword@proxy.us.somecompany:8080
set HTTP_PROXY=http://myusername:mypassword@proxy.us.somecompany:8080
export HTTPS_PROXY=http://myusername:mypassword@proxy.us.somecompany:8080
export HTTP_PROXY=http://myusername:mypassword@proxy.us.somecompany:8080
export http_proxy=http://myusername:mypassword@proxy.us.somecompany:8080

npm --proxy http://myusername:mypassword@proxy.us.somecompany:8080 \
--without-ssl --insecure -g install

我正在运行:nom 版本 2.5.1、Sencha touch 2.4.1、Sencha cmd 5.1.2.52。

有什么想法可能导致这种情况吗?

请帮忙。谢谢。

最佳答案

已修复。

我必须将 node.js 降级到 10.25 才能使其正常工作。一旦安装了新版本,就不再设置代理。 (我有 12.0,但也听说 11.x 不太好用。)

以下是操作说明:http://www.websector.de/blog/2011/12/15/quick-tip-node-how-to-downgrade-node-js-on-os-x/

关于node.js - 从 cmd 运行 cordova 时出现 npm http GET 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28970995/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com