0

I'm installing PhoneGap/Cordova. When I run the command line npm install -g phonegap, I get the following. Has anyone run into this? Is this a problem with PhoneGap or my configuration? 407 is Proxy Authentication. I'm behind a proxy and I have already configured that information.

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>&nbsp;</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
jlembke
  • 13,217
  • 11
  • 42
  • 56
  • have a look at this post : http://stackoverflow.com/questions/18569054/npm-behind-ntlm-proxy/18570201#18570201 – QuickFix Jan 15 '14 at 23:14

2 Answers2

1

You said you configured npm to use the proxy, but I think it is obvious from the error that you did not - or maybe did so correctly. Have you tried double checking?

Maybe try "npm config get proxy" to confirm?

Raymond Camden
  • 10,661
  • 3
  • 34
  • 68
  • I verified the proxy and port with our Admin here. And I ran "npm config list" to check that it was correct. In fact, that error looks to me like a lot of html from phonegap, so I'm pretty sure I'm making it outside the firewall. – jlembke Jan 15 '14 at 23:13
  • I don't know - the HTML there looks like a firewall issue. I don't see anything in there related to phonegap.com, outside of the URL reported. – Raymond Camden Jan 15 '14 at 23:17
  • 1
    Ah look - it is asking for authentication. Did you specify those values too? Here is an example - oops - hit enter:npm config set proxy http://login:pass@host:port $ npm config set https-proxy http://login:pass@host:port – Raymond Camden Jan 15 '14 at 23:18
  • Ugh - sorry - I have no idea how to do a line break in comments - but hopefully you can read the above. – Raymond Camden Jan 15 '14 at 23:18
  • Turns out we have a lot of unexpected things going on with our corporate firewall. And we allow things like spaces in usernames and other details that cause problems to work around. Bottom line, we abandoned the effort, and found a way to circumvent our corp proxy altogether. PhoneGap installed. :) – jlembke Jan 16 '14 at 21:26
0

I am using windows 10 and what worked for me where the following instructions

  1. npm config set strict-ssl false
  2. npm config set registry "http://registry.npmjs.org/"
  3. npm config set proxy "http://domain%5Cusername:password@server.url.com:port"

you might also want to set the http-proxy config as well just replace http with https in #3 for that.

Make sure of the following A. In case you are against a proxy and using AD then your user name should be in the format domain%5Cusername where %5C is for "\" otherwise it should be only "username"

B. In case your password contains special characters encode them like for @ symbol use %40 and likewise