离子安装错误状态代码400

时间:2015-11-04 16:00:13

标签: ionic-framework ionic

欢迎我想安装离子,但我不能。我安装了corodva。 我的错误状态代码400(错误请求)为什么?

> C:\Windows\System32>npm install -g cordova
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"4.2.2","npm":"2.14.3"})
C:\Users\kacper\AppData\Roaming\npm\cordova -> C:\Users\kacper\AppData\Roaming\npm\node_modules\cordova\bin\cordova
cordova@5.3.1 C:\Users\kacper\AppData\Roaming\npm\node_modules\cordova
├── underscore@1.7.0
├── q@1.0.1
├── nopt@3.0.1 (abbrev@1.0.7)
└── cordova-lib@5.3.1 (valid-identifier@0.0.1, unorm@1.3.3, osenv@0.1.0, properties-parser@0.2.3, bplist-parser@0.0.6, semver@4.3.6, shelljs@0.3.0, cordova-app-hello-world@3.9.0, npm@2.14.3, dep-graph@1.1.0, rc@0.5.2, xcode@0.8.0, elementtree@0.1.6, npmconf@2.1.2, glob@4.0.6, plist@1.1.0, cordova-serve@0.1.3, request@2.47.0, aliasify@1.7.2, init-package-json@1.9.1, tar@1.0.2, cordova-registry-mapper@1.1.11, cordova-js@4.1.1)

C:\Windows\System32>npm install -g ionic
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kacper\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ionic"
npm ERR! node v4.2.2
npm ERR! npm  v2.14.3
npm ERR! code ECONNRESET

npm ERR! network tunneling socket could not be established, statusCode=400
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Windows\System32\npm-debug.log

帮助我。

2 个答案:

答案 0 :(得分:0)

您必须安装Node JS版本0.12.6,之后

npm install -g cordova ionic

它将安装Ionic和Cordova。

答案 1 :(得分:0)

首先从

下载并安装node.js.

https://nodejs.org/en/

然后重启你的电脑

如果您在代理网络中,请通过

在CMD(命令提示符)中设置您的http / https代理
set http_proxy=http://[proxy_ip]:[proxy_port]
set https_proxy=https://[proxy_ip]:[proxy_port]

然后使用

npm cache clean 

清除npm的缓存文件夹

然后使用以下ling来安装ionic和cordovo

npm install -g cordova ionic