npm 错误!在“...registry.npmjs.org/@i"附近解析时意外结束 JSON 输入 [英] npm ERR! Unexpected end of JSON input while parsing near '...registry.npmjs.org/@i'

查看:33
本文介绍了npm 错误!在“...registry.npmjs.org/@i"附近解析时意外结束 JSON 输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 ionic 的新手,我仍在尝试安装它.每次我编写像 npm install -g ionic cordova 这样的 ionic 命令时,我都会收到此错误

I am new to ionic and i am still trying to install it. Everytime i write an ionic command like npm install -g ionic cordova i receive this error

    npm ERR! Unexpected end of JSON input while parsing near '...de":"0.6.2","express"'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersDwayneTAppDataRoaming
pm-cache\_logs2019-05-31T01_51_23_542Z-debug.log

'

这是我的日志文件

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli   
'C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\bin\npm- 
cli.js',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'ionic',
1 verbose cli   'cordova' ]
2 info using npm@6.9.0
3 info using node@v8.11.1
4 verbose npm-session bf0a16c3729a6897
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 http://registry.npmjs.org/cordova 1407ms (from cache)
8 silly fetchPackageMetaData error for cordova@latest Unexpected end of JSON 
input while parsing near '...de":"0.6.2","express"'
9 http fetch GET 304 http://registry.npmjs.org/ionic 1418ms (from cache)
10 silly pacote tag manifest for ionic@latest fetched in 1452ms
11 timing stage:rollbackFailedOptional Completed in 1ms
12 timing stage:runTopLevelLifecycles Completed in 1466ms
13 verbose stack SyntaxError: Unexpected end of JSON input while parsing 
near '...de":"0.6.2","express"'
13 verbose stack     at JSON.parse (<anonymous>)
13 verbose stack     at parseJson 
(C:UsersDwayneTAppDataRoaming
pm
ode_modules
pm
ode_modulesjson- 
parse-better-errorsindex.js:7:17)
13 verbose stack     at consumeBody.call.then.buffer 
(C:UsersDwayneTAppDataRoaming
pm
ode_modules
pm
ode_modules
ode- 
fetch-npmsrcody.js:96:50)
13 verbose stack     at <anonymous>
13 verbose stack     at process._tickCallback 
(internal/process/next_tick.js:188:7)
14 verbose cwd C:UsersDwayneT
15 verbose Windows_NT 10.0.18362
16 verbose argv "C:\Program Files\nodejs\node.exe" 
"C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\bin\npm- 
cli.js" "install" "-g" "ionic" "cordova"
17 verbose node v8.11.1
18 verbose npm  v6.9.0
19 error Unexpected end of JSON input while parsing near 
'...de":"0.6.2","express"'
20 verbose exit [ 1, true ]

我尝试了很多解决方案,包括

I have tried many solutions including

npm cache clean --force

但似乎没有任何效果,我现在是.请协助.我正在使用节点 v 8

but nothing seems to work and i am now now. Kindly assist please. I am using node v 8

推荐答案

这是 npm 损坏缓存的问题.您可以使用 npm 本身清除它.

It is the problem with npm corrupt caches. You can clear it using npm itself.

我解决了

npm cache clean --force

然后更新 npm

npm i npm@latest -g

然后通常使用您的 npm install 命令

then normally use your npm install command

npm install 

这篇关于npm 错误!在“...registry.npmjs.org/@i"附近解析时意外结束 JSON 输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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