我正在安装PhoneGap / Cordova。当我运行命令行npm install -g phonegap
时,我得到以下内容。有没有人碰到这个?这是PhoneGap或我的配置有问题吗? 407是代理验证。我在代理服务器后面,我已经配置了这些信息。
C:\Users\jtlembke>npm install -g phonegap
npm http GET http://registry.npmjs.org/phonegap
npm http 407 http://registry.npmjs.org/phonegap
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
npm ERR! "http://www.w3.org/TR/html4/loose.dtd">
npm ERR! <html>
npm ERR! <head>
npm ERR! <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
npm ERR! <title>Notification: Proxy Authorization Required</title>
npm ERR! <style type="text/css">
npm ERR! body {
npm ERR! font-family: Arial, Helvetica, sans-serif;
npm ERR! font-size: 14px;
npm ERR! color:#333333;
npm ERR! background-color: #ffffff;
npm ERR! }
npm ERR! h1 {
npm ERR! font-size: 18px;
npm ERR! font-weight: bold;
npm ERR! text-decoration: none;
npm ERR! padding-top: 0px;
npm ERR! color: #2970A6;
npm ERR! }
npm ERR! a:link {
npm ERR! color: #2970A6;
npm ERR! text-decoration: none;
npm ERR! }
npm ERR! a:hover {
npm ERR! color: #2970A6;
npm ERR! text-decoration: underline;
npm ERR! }
npm ERR! p.buttonlink {
npm ERR! margin-bottom: 24px;
npm ERR! }
npm ERR! .copyright {
npm ERR! font-size: 12px;
npm ERR! color: #666666;
npm ERR! margin: 5px 5px 0px 30px;
npm ERR!
npm ERR! }
npm ERR! .details {
npm ERR! font-size: 14px;
npm ERR! color: #969696;
npm ERR! border: none;
npm ERR! padding: 20px 20px 20px 20px;
npm ERR! margin: 0px 10px 10px 35px;
npm ERR! }
npm ERR!
npm ERR! .shadow {
npm ERR! border: 3px solid #9f9f9f;
npm ERR! padding: 10px 25px 10px 25px;
npm ERR! margin: 10px 35px 0px 30px;
npm ERR! background-color: #ffffff;
npm ERR! width: 600px;
npm ERR!
npm ERR! -moz-box-shadow: 3px 3px 3px #cccccc;
npm ERR! -webkit-box-shadow: 3px 3px 3px #cccccc;
npm ERR! box-shadow: 3px 3px 3px #cccccc;
npm ERR! /* For IE 8 */
npm ERR! -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=5, Dir
ection=135, Color='cccccc')";
npm ERR! /* For IE 5.5 - 7 */
npm ERR! filter: progid:DXImageTransform.Microsoft.Shadow(Strength=5, Directio
n=135, Color='cccccc');
npm ERR! }
npm ERR! .logo {
npm ERR! border: none;
npm ERR! margin: 5px 5px 0px 30px;
npm ERR! }
npm ERR! </style>
npm ERR! </head>
npm ERR!
npm ERR! <body>
npm ERR! <div class="logo"></div><p> </p>
npm ERR! <div class="shadow">
npm ERR! <h1>This Page Cannot Be Displayed</h1>
npm ERR!
npm ERR!
npm ERR! <p>
npm ERR! Authentication is required to access the Internet using this system.
npm ERR! A valid user ID and password must be entered when prompted.
npm ERR! </p>
npm ERR!
npm ERR!
npm ERR!
npm ERR! <p>
npm ERR! If you have questions, please contact
npm ERR! your organization's network administrator
npm ERR! and provide the codes shown below.
npm ERR! </p>
npm ERR!
npm ERR! </div>
npm ERR!
npm ERR! <div class="details"><p>
npm ERR! Date: Wed, 15 Jan 2014 22:34:48 GMT<br />
npm ERR! Username: <br />
npm ERR! Source IP: 160.69.14.20<br />
npm ERR! URL: GET http://registry.npmjs.org/phonegap<br />
npm ERR! Category: <br />
npm ERR! Reason: UNKNOWN<br />
npm ERR! Notification: PROXY_AUTH_REQUIRED
npm ERR! </p></div>
npm ERR! </body>
npm ERR! </html>
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient.<anonymous> (C:\Program Files\nodejs\node_modules\npm\
node_modules\npm-registry-client\lib\request.js:241:23)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm\
node_modules\request\request.js:123:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:893:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage.<anonymous> (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:844:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "phonegap"
npm ERR! cwd C:\Users\jtlembke
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! type unexpected_token
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\jtlembke\npm-debug.log
npm ERR! not ok code 0
答案 0 :(得分:1)
你说你配置了npm来使用代理,但我认为从错误中可以明显看出你没有 - 或者可能是这样做的。你试过双重检查吗?
也许尝试“npm config get proxy”来确认?
答案 1 :(得分:0)
我正在使用Windows 10以及对我有用的内容,其中包含以下说明
您可能还想设置http-proxy配置,只需将http替换为#3中的https。
确保以下内容 答:如果您反对代理并使用AD,那么您的用户名应采用 domain%5Cusername 格式,其中%5C用于&#34; \&#34;否则它应该只是&#34;用户名&#34;
B中。如果您的密码包含特殊字符,请对其进行编码,例如@符号使用%40,同样