摘要

  最近更新了一次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. 慎用array_filter函数

    array_filter (PHP 4 >= 4.0.6, PHP 5, PHP 7) array_filter - 用回调函数过滤数组中的单元 说明 array array_filter (  ...

  2. oracle数据库使用PL/sql导入excel数据

    1.打开PL/SQL工具,菜单进入   工具>ODBC导入器(菜单列表倒数第二): 2.连接数据库与选择导入的excel文件表: 3.选择导入的表以及excel与数据库表字段之间的对应关系:

  3. nodejs连接mongodb(密码)

    const MongoClient = require('mongodb').MongoClient; const url = 'mongodb://user:password@localhost:2 ...

  4. Android view的一些认识

    转载:9102年末,我对Android view的13条认识: (顺手留下GitHub链接,需要获取相关面试等内容的可以自己去找)https://github.com/xiangjiana/Andro ...

  5. iOS-同步下载与异步下载

    一.同步下载(交互不好,容易出现卡死现象,一般下载数据较小或有特定需求才使用). 发送同步请求后,程序将停止用户交互,直到服务器返回数据完成后,才进行下一步的操作. //第一步:创建URL NSURL ...

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

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

  7. [非原创]Office 2019 增强版 批处理激活 亲测成功

    忘了原创网址了,在 https://www.52pojie.cn/ 上看到的,这里我备忘一下,希望知道原创网址的朋友告诉我一下,谢谢! 将下面批处理脚本存成.bat文件后,以管理员方式运行: @ech ...

  8. 【算法】矩阵填数,深度优先搜索(DFS),Pascal改C语言

    面向对象的上机实验 题目 以下列方式向 5*5 矩阵中填入数字.设数字i(1=<i<=25),则数字i+1 的坐标位置应为(E, W).(E, W)可根据下列关系由(x,y)算出: 1)( ...

  9. VS开发】C中调用C++文件中定义的function函数

    [VS开发]C中调用C++文件中定义的function函数 标签(空格分隔): [VS开发] 声明:引用请注明出处http://blog.csdn.net/lg1259156776/ 精要一揽 C调用 ...

  10. Reactor系列(四)subscribe订阅

    #java# #reactor# #subcribe# #订阅# 视频讲解 :https://www.bilibili.com/video/av79117693/ FluxMonoTestCase.j ...