npm ERR! registry error parsing json - While trying to install Cordova for Ionic Framework in Windows 8

后端 未结 12 1166
感情败类
感情败类 2020-12-13 08:31

I was trying to instal Ionic framework in my Windows 8 system and was trying to install Cordova first.

I\'m getting this error while trying to install Cordova, that

相关标签:
12条回答
  • 2020-12-13 09:08

    I had similar problem. I rаn npm cache clear, closed android SDK manager(which was open before) and re-ran npm install -g cordova and that was enough to solve the problem.

    0 讨论(0)
  • 2020-12-13 09:08

    I had this same problem when trying to upgrade pm2 to the latest version.

    Thanks to sdm's answer I did npm update npm -g and it did the trick for me.

    0 讨论(0)
  • 2020-12-13 09:10

    For me following fixed the issue:

    1. npm cache clear
    2. Made sure that NPM & Git proxies are set properly

    In this case Git proxy may not be required.

    0 讨论(0)
  • 2020-12-13 09:15

    first I had to delete my registry by using npm config delete registry and register new value using npm config set registry "http://registry.npmjs.org"

    0 讨论(0)
  • 2020-12-13 09:15

    In my case all Internet access must run through a proxy and npm was not configured with the proxy to reach http://registry.npmjs.org.

    I ran npm install --log-level verbose to get more information and saw that the response had HTML stating I was not authenticated with the proxy.

    Running the following fixed it (replacing below with your username/password/proxy address:

    npm config set proxy 'username:password@your.proxy.com'
    npm config set https-proxy 'username:password@your.proxy.com'
    

    I do not advise putting the password in raw text instead using something like cntlm to set up a local proxy that delegates to the real proxy.

    0 讨论(0)
  • 2020-12-13 09:16

    I had the same issue and the following fixed my issue:

    1. Set the registry: npm config set registry "http://registry.npmjs.org/"
    2. Removed the entry in hosts file (using Windows 7) => C:\Windows\System32\drivers\etc\hosts
    0 讨论(0)
提交回复
热议问题