我尝试安装cordova cli以将其用于phonegap应用程序,我安装了所需的node.js版本和git客户端。但是当我输入命令“C:> npm install -g cordova”时,我收到此错误,npm WARN unmet dependency C:\Users\username\AppData\Roaming\npm\node_modules\phon
egap requires cordova@'2.7.4' but will load
npm WARN unmet dependency C:\Users\username\AppData\Roaming\npm\node_modules\cord
ova,
npm WARN unmet dependency which is version 5.1.1
cordova@5.1.1 C:\Users\username\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.1.1 (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, semver@2.1.0, rc@0.5.2, dep-
graph@1.1.0, shelljs@0.3.0, npmconf@0.1.16, through2@0.6.3, xcode@0.6.7, init-pa
ckage-json@1.7.0, d8@0.4.4, glob@4.0.6, elementtree@0.1.6, request@2.47.0, cordo
va-registry-mapper@1.1.8, tar@1.0.2, plist@1.1.0, cordova-js@4.0.0, cordova-app-
hello-world@3.9.0, npm@1.3.4)
有人可以帮助我吗?
答案 0 :(得分:0)
这是一个警告。无论如何,应该安装Cordova
请尝试重新安装。
在此之前清理缓存:
//DRAG CONDITIONS
$("#drag-1").draggable({
containment: '.zone-container',
snap: '#drag-1',
revert: 'invalid'
});
$("#drag-2").draggable({
containment: '.zone-container',
snap: '#drag-2',
revert: 'invalid'
});
$("#drag-3").draggable({
containment: '.zone-container',
snap: '#drag-3',
revert: 'invalid'
});
//DROP & ACTION
$("#drop-1").droppable({
accept: "#drag-1",
drop: function (event, ui) {
$('.popup').show();
}
});
$("#drop-2").droppable({
accept: "#drag-2",
drop: function (event, ui) {
$('.popup').show();
}
});
$("#drop-3").droppable({
accept: "#drag-3",
drop: function (event, ui) {
$('.popup').show();
}
});
删除cordova
npm cache clean
可能会更新npm包管理器:
npm uninstall -g cordova
再次重新安装cordova:
npm install -g npm