cordova的安装问题

时间:2015-04-21 14:47:03

标签: node.js cordova ionic

我已从官方nodejs.org网站安装了最新版本的node.js,但是当我在我的cmd窗口中运行install命令时 npm install -g cordova

安装时出现以下警告。

npm WARN engine cordova-js@3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN installMany normalize-package-data was bundled with npm@1.3.4, but bundled package wasn't found in unpacked tree
C:\Users\Gaurav\AppData\Roaming\npm\cordova -> C:\Users\Gaurav\AppData\Roaming\npm\node_modules\cordova\bin\cordova
cordova@5.0.0 C:\Users\Gaurav\AppData\Roaming\npm\node_modules\cordova
├── underscore@1.7.0
├── q@1.0.1
├── nopt@3.0.1 (abbrev@1.0.5)
└── cordova-lib@5.0.0 (valid-identifier@0.0.1, osenv@0.1.0, properties-parser@0.2.3, bplist-parser@0.0.6, mime@1.2.11, unorm@1.3.3, semve
r@2.1.0, rc@0.5.2, shelljs@0.3.0, dep-graph@1.1.0, npmconf@0.1.16, through2@0.6.3, xcode@0.6.7, d8@0.4.4, init-package-json@1.4.2, elemen
ttree@0.1.5, request@2.47.0, tar@1.0.2, glob@4.0.6, cordova-registry-mapper@1.1.2, cordova-app-hello-world@3.9.0, plist@1.1.0, cordova-js
@3.9.0, npm@1.3.4)

2 个答案:

答案 0 :(得分:1)

您使用的节点版本高于所需的节点。

cordova需要0.10.0,您有0.12.2

我建议您使用nvm轻松安装不同版本。

首先使用此命令安装nvm

curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash

然后您可以使用nvm install 0.10

的特定版本

以下是您格式化的错误。

npm WARN engine cordova-js@3.9.0: wanted: {"node":"~0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine npm@1.3.4: wanted: {"node":">=0.6","npm":"1"} (current: {"node":"0.12.2","npm":"2.7.4"})
npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.2","npm":"2.7.4"}) 

答案 1 :(得分:0)

这些只是警告说所需的最小版本的node.js与您的nodejs版本(v0.12.2)不同。

这不应该是你的问题