Tony
Tony

Reputation: 17647

npm ERR! registry error parsing json

I am working on a small Cordova v4.0.0 project, npm version: v0.10.35 I was adding some plugins, normally, until now, when I try to add another plugin, it gives an error:

cordova plugin add org.apache.cordova.NetworkManager
Fetching plugin "org.apache.cordova.NetworkManager" via plugin registry
npm ERR! registry error parsing json
npm ERR! registry error parsing json
SyntaxError: Unexpected token I
Internal routing error

Sorry, we cannot connect to the intended server.

We have just been notified of this problem. We will correct it as soon as possible.

Feel free to contact us if you have any questions: support at iriscouch.com

    at Object.parse (native)
    at RegClient.<anonymous> (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:274:23)
    at C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:251:7
    at Gunzip.onEnd (zlib.js:167:5)
    at Gunzip.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:442:13)

In my attempt to solve this, I did:

npm cache clean

I had some proxy, installed by a spyware, that I uninstalled. I already cleared windows proxy settings, and npm proxy settings:

npm config rm proxy
npm config rm https-proxy

But it stills not working.

Update on Jan 12, 2015:

cordova plugin add org.apache.cordova.NetworkManager
Fetching plugin "org.apache.cordova.NetworkManager" via plugin registry
Error: 404 Not Found: org.apache.cordova.NetworkManager
    at RegClient.<anonymous> (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:304:14)
    at Request._callback (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\npm-registry-client\lib\request.js:246:65)
    at Request.self.callback (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\request.js:236:22)
    at Request.emit (events.js:98:17)
    at Request.<anonymous> (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\request.js:1142:14)
    at Request.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (C:\Users\Tony\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\request.js:1096:12)
    at IncomingMessage.emit (events.js:117:20)
    at _stream_readable.js:944:16
    at process._tickCallback (node.js:442:13)

Alternative solution is to use git:

cordova plugin add https://github.com/apache/cordova-plugin-network-information

.

Fetching plugin "https://github.com/apache/cordova-plugin-network-information" via git clone
Installing "org.apache.cordova.network-information" for android
Installing "org.apache.cordova.network-information" for windows

Upvotes: 8

Views: 15484

Answers (1)

focused4success
focused4success

Reputation: 433

The server isn't responding. For the time being, you can install most of the plugins from GitHub like this:

cordova plugin add https://github.com/apache/cordova-plugin-network-information

or

cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git

Be aware, it is possible side effects may occur due to dependencies between plugins and differences in versions that would have to be solved on a case by case basis. Let's hope this isn't a chronic problem.

Upvotes: 6

Related Questions