摘要

  最近更新了一次node,但是更新后npm的命令总是会报

npm WARN deprecated fsevents@2.0.6: Please update: there are crash fixes
npm WARN deprecated text-encoding@0.7.0: no longer maintained
npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN deprecated core-js@2.3.0: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ajv@^6.5.5 (node_modules\har-validator\node_modules\ajv):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Unexpected end of JSON input while parsing near '...:"^2.0.0-rc.0","glob"'

npm ERR! Unexpected end of JSON input while parsing near '...:"^2.0.0-rc.0","glob"'

的错误信息,导致无法进行正常的npm install。经过半天的错误信息搜索,找到了较为友好的解决办法。

解决办法

方法一:清除npm缓存

  具体命令步骤:

npm cache clean --force //清除npm缓存
npm install @(Library you need) //下载安装你需要的库

方法二:删除合并文件

  具体命令步骤:

删除package.lock.json合并文件
npm install @(Library you need) //下载安装你需要的库

方法三:配置默认注册表

  具体命令步骤:  

注册表配置修改为默认值:
npm config set registry https://registry.npmjs.org/

参考地址:https://github.com/npm/npm/issues/19072

总结

  分享一下解决npm的JSON意外结束的方法,大家如果有更好的办法可以评论出来,一起学习。。。

解决npm ERR!Unexpected end of JSON input while paring near (解析附近时JSON输入意外结束)'...."^2.0.0-rc.0","glob"'等npm install错误的更多相关文章

  1. 解决npm ERR! Unexpected end of JSON input while parsing near的方法

    这两天执行 npm install 时会报错误: npm ERR! Unexpected end of JSON input while parsing near 清除cache npm cache ...

  2. 解决【npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141072930277'】方案

    问题描述执行npm install的时候报错npm ERR! Unexpected end of JSON input while parsing near '...sh_time":141 ...

  3. npm err! Unexpected end of JSON input while parsing near解决办法

    npm install时出现npm err! Unexpected end of JSON input while parsing near错误 输入  npm cache clean --fore ...

  4. 当遇到npm ERR! Unexpected end of JSON input while parsing near……时的解决办法

    运行npm install时有时会遇到以下错误: npm ERR! Unexpected end of JSON input while parsing near ... 这时可以先执行下面的命令: ...

  5. npm ERR! Unexpected end of JSON input while parsing near '...'解决方法

    npm install时出现npm err! Unexpected end of JSON input while parsing near'...'错误 输入  npm cache clean -- ...

  6. 【NPM】npm ERR! Unexpected end of JSON input while parsing near '...",'解决方案

    问题描述 今天安装项目依赖npm install 的时候出现错误: npm ERR! Unexpected end of JSON input while parsing near '...e&quo ...

  7. npm ERR! Unexpected end of JSON input while parsing near '...inimist":"^1.2.0"}

    简介 在项目中执行npm install安装依赖包的时候.出现npm ERR! Unexpected end of JSON input while parsing near '...inimist& ...

  8. [NPM错误]npm ERR! Unexpected end of JSON input while parsing near ‘’

    [错误描述] npm ERR! Unexpected end of JSON input while parsing near ‘  ’ [前提描述] 在安装vue2-editor时,中断暂停了,再次 ...

  9. npm ERR! Unexpected token in JSON at position 0 while parsing near '<HTML> 解决办法

    npm ERR! Unexpected token in JSON at position 0 while parsing near '<HTML> npm ERR! <!--/// ...

随机推荐

  1. 进程 | 线程 | 当Linux多线程遭遇Linux多进程

    背景 本文并不是介绍Linux多进程多线程编程的科普文,如果希望系统学习Linux编程,可以看[<Unix环境高级编程>第3版] 本文是描述多进程多线程编程中遇到过的一个坑,并从内核角度分 ...

  2. API网关的用处

    API网关我的分析中会用到以下三种场景. Open API. 企业需要将自身数据.能力等作为开发平台向外开放,通常会以rest的方式向外提供,最好的例子就是淘宝开放平台.腾讯公司的QQ开发平台.微信开 ...

  3. Swift 构造过程

    构造过程是为了使用某个类.结构体或枚举类型的实例而进行的准备过程.这个过程包含了为实例中的每个属性设置初始值和为其执行必要的准备和初始化任务. Swift 构造函数使用 init() 方法. 与 Ob ...

  4. multiprocessing.Pool报pickling error

    multiprocessing.Pool报pickling error 现象 multiprocessing.Pool传递一个普通方法(不在class中定义的)时, 能正常工作. from multi ...

  5. c++ vector容器自增长

    #include <iostream>#include <vector> using namespace std; int main(){ vector<int> ...

  6. Flutter 异步Future与FutureBuilder实用技巧

    什么是Future? Future表示在接下来的某个时间的值或错误,借助Future我们可以在Flutter实现异步操作.它类似于ES6中的Promise,提供then和catchError的链式调用 ...

  7. Mac下Unity使用Jenkins自动化打包

    重要的事情说三遍:不要使用jenkins dmg安装包直接安装,用brew安装  PS:会有权限问题 重要的事情说三遍:不要使用jenkins dmg安装包直接安装,用brew安装 重要的事情说三遍: ...

  8. for 和 while 用于遍历时候的区别

    for: 以空格作为间隔符,输出字段. read: 以行作为间隔符,输出字段. 对于文件来说,如果只有一列,for  和  read 无区别, 多列的话, 有区别. read  用法详情: 见 如下转 ...

  9. 连接池和JDBCTemplate

    一:什么是连接池?使用连接池的好处是什么? 连接池就是一个存放数据库连接对象的容器.当系统初始化后,就会向数据库申请一些连接对象存放到容器里,用的时候直接从容器里取,用完后放回连接池. 连接池可以提高 ...

  10. 盒模型中padding、border、margin的区别

    在CSS中,规定了一种基本设计模型——盒模型(也叫框模型),如图所示: 其中包含了四部分内容:element/元素(即图中文字).padding/内边框(图中两个红色边框之间白色部分).border/ ...