我有Windows 7操作系统,通过cmd如果我多次运行 npm install -g cordova 会发生什么?
我面临以下错误: - 错误的ERR!提取失败https://registry.npmjs.org/cordova-app-hello-world/-/cordo VA-APP-HELLO-世界3.10.0.tgz
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Sandy_PC>node --version
v4.3.0
C:\Users\Sandy_PC>npm unistall -g cordova
Usage: npm <command>
where <command> is one of:
access, add-user, adduser, apihelp, author, bin, bugs, c,
cache, completion, config, ddp, dedupe, deprecate, dist-tag,
dist-tags, docs, edit, explore, faq, find, find-dupes, get,
help, help-search, home, i, info, init, install, issues, la,
link, list, ll, ln, login, logout, ls, outdated, owner,
pack, ping, prefix, prune, publish, r, rb, rebuild, remove,
repo, restart, rm, root, run-script, s, se, search, set,
show, shrinkwrap, star, stars, start, stop, t, tag, team,
test, tst, un, uninstall, unlink, unpublish, unstar, up,
update, upgrade, v, verison, version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm faq commonly asked questions
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\Sandy_PC\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@2.14.12 C:\Program Files\nodejs\node_modules\npm
C:\Users\Sandy_PC>npm install -g cordova
npm ERR! fetch failed https://registry.npmjs.org/cordova-app-hello-world/-/cordo
va-app-hello-world-3.10.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ECONNREFUSED 18
5.31.17.162:443
npm ERR! fetch failed https://registry.npmjs.org/cordova-app-hello-world/-/cordo
va-app-hello-world-3.10.0.tgz
npm WARN retry will retry, error on last attempt: Error: connect ECONNREFUSED 18
5.31.17.162:443
npm ERR! fetch failed https://registry.npmjs.org/cordova-app-hello-world/-/cordo
va-app-hello-world-3.10.0.tgz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! syscall connect
npm ERR! Error: connect ECONNREFUSED 185.31.17.162:443
npm ERR! at Object.exports._errnoException (util.js:870:11)
npm ERR! at exports._exceptionWithHostPort (util.js:893:20)
npm ERR! at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
npm ERR! { [Error: connect ECONNREFUSED 185.31.17.162:443]
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! syscall: 'connect',
npm ERR! address: '185.31.17.162',
npm ERR! port: 443,
npm ERR! parent: 'cordova-lib' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Sandy_PC\npm-debug.log
C:\Users\Sandy_PC>
&#13;
答案 0 :(得分:1)
npm install -g cordova
获取repo中可用的任何新版本的cordova,并将其安装在您的设备中,替换以前的版本。
npm update -g cordova
做同样的事情。但是,使用npm install,您可以选择特定版本。
例如:npm install -g cordova@3.1.0-0.2.0
本身。