错误的ERR!注册表错误解析json - 尝试在Windows 8中安装Cordova for Ionic Framework

Swo*_*kya 44 npm

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

我说,在尝试安装Cordova时,我遇到了这个错误

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>
Run Code Online (Sandbox Code Playgroud)

我的系统配置如下:

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
Run Code Online (Sandbox Code Playgroud)

我已经做了

C:\Windows\System32>npm cache clear
Run Code Online (Sandbox Code Playgroud)

在运行install命令之前没有用.

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

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

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

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

sdm*_*sdm 91

在我的情况下,我有一个非常老版本的npm.使用sudo npm install npm -g修复问题为我升级npm .另外我还做了rm -rf node_modulesnpm cache cleannpm config set registry "http://registry.npmjs.org/"

  • 大.我不得不使用`sudo npm cache clean`然后使用`sudo npm install npm -g` (4认同)
  • npm配置集注册表"http://registry.npmjs.org/"<是有帮助的,不知道问题.. (2认同)

Boj*_*ski 20

我有类似的问题.我已经npm cache clear关闭了android SDK管理器(之前已经打开)并重新运行npm install -g cordova,这足以解决问题.


Fre*_*ond 8

npm config set registry "http://registry.npmjs.org"
Run Code Online (Sandbox Code Playgroud)

为我解决了这个问题.请注意,它不会在URL的末尾加上正斜杠,而且必须完全按照上面所示输入.