欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZ

程序员文章站 2022-07-03 08:43:07
...

问题呈现

npm install @babel/preset-env --save-dev
npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZmVC6WEx1k\n'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-03-01T04_37_19_578Z-debug.log
PS C:\Users\Administrator\Desktop\webpack4.x> npm install @babel/preset-env --save-dev
npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZmVC6WEx1k\n'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-03-01T04_38_01_505Z-debug.log

解决方案

第一步:运行npm cache clean --force
npm cache clean --force
第二步:运行npm install @babel/preset-env --save-dev
npm install @babel/preset-env --save-dev

呈现结果

npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZ
npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZ

相关标签: webpack