npm 错误!解析 json 时出现注册表错误 - 尝试在 Windows 8 中为 Ionic Framework 安装 Cordova [英] npm ERR! registry error parsing json - While trying to install Cordova for Ionic Framework in Windows 8

查看:54
本文介绍了npm 错误!解析 json 时出现注册表错误 - 尝试在 Windows 8 中为 Ionic Framework 安装 Cordova的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 Windows 8 系统中安装 Ionic 框架,并试图先安装 Cordova.

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

我在尝试安装 Cordova 时遇到此错误,提示

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

Your environment has been set up for using Node.js 0.12.4 (x64) and npm.

C:\Users\Sworup>npm install -g cordova ionic
npm ERR! registry error parsing json
npm ERR! tar.unpack untar error C:\Users\Sworup\AppData\Local\Temp\npm-1424-df7f
43fe\registry.npmjs.org\underscore\-\underscore-1.7.0.tgz
npm ERR! tar.unpack untar error C:\Users\Sworup\AppData\Local\Temp\npm-1424-df7f
43fe\registry.npmjs.org\npm\-\npm-2.1.3.tgz
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" "ionic"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read

npm ERR! network read ECONNRESET
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! tar.unpack untar error C:\Users\Sworup\AppData\Local\Temp\npm-1424-df7f
43fe\registry.npmjs.org\prompt\-\prompt-0.2.12.tgz
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova" "ionic"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1

npm ERR! unexpected eof
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Sworup\npm-debug.log

C:\Users\Sworup>

我的系统配置如下:

C:\Windows\System32>npm -v
2.10.1

C:\Windows\System32>node -v
v0.12.4

C:\Windows\System32>git --version
git version 1.9.4.msysgit.1

我已经做了

C:\Windows\System32>npm cache clear

之前运行安装命令没有用.

before running the install command to no use.

我尝试将注册表更改为 http 仍然没有用.

I tried changing the registry to http still no use.

我尝试单独安装 Ionic 框架,仍然没有成功.

I tried installing Ionic framework separately, still no luck.

我尝试安装 Phonegap,与上述相同的错误.

I tried installing Phonegap, same errors as above.

我只是被困在这一点上,不知道该怎么做.

I'm just stuck at this point and have no idea what to do.

推荐答案

就我而言,我有一个非常旧的 npm 版本.使用 sudo npm install npm -g 升级 npm 为我解决了这个问题.另外我还做了 rm -rf node_modulesnpm cache cleannpm config set registry "http://registry.npmjs.org/"

In my case, I had a very old version of npm. Upgrading npm using sudo npm install npm -g fixed the problem for me. Additionally I also did rm -rf node_modules and npm cache clean and npm config set registry "http://registry.npmjs.org/"

这篇关于npm 错误!解析 json 时出现注册表错误 - 尝试在 Windows 8 中为 Ionic Framework 安装 Cordova的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆