npm install 时出现 Unexpected end of JSON input while parsing near···

今早上下载vue/cli的时候,一直有这个错误。查了之后,得知原因是因为最新版本的Node.js与npm版本不适合(昨天刚下载了最新的node)。

解决办法就是把npm的版本降到4版。

使用命令 npm -g i [email protected]

而且,还查到另外一种的解决办法:
npm cache clean --force清理缓存,直接安装。

但是试过之后,还是不能解决这个问题。

所以这个方法可能不能解决node版本太高,导致npm版本不合适的问题。
 


原文地址:https://www.cnblogs.com/renranwj/p/11790884.html

时间: 2024-07-30 20:17:57

npm install 时出现 Unexpected end of JSON input while parsing near···的相关文章

npm 在安装 Vue脚手架命令(npm install -g @vue/cli)时报错安装报错--“Unexpected end of JSON input while parsing near···”

在安装Vue的脚手架(npm install -g @vue/cli 项目名称)时,提示: Unexpected end of JSON input while parsing near 其实,但凡使用npm 时,只要提示这个,都可以按照以下几种方式进行尝试. 第一种:删掉package.lock.json 第二种:清除cache npm cache clean --force第三种:进入下面这个文件夹,把文件夹npm-cache下的内容删除掉(清除cache) 路径:C:/Users/DELL

npm install "Unexpected end of JSON input while parsing near"问题

问题 最近配了台新电脑,开始装Node环境,去官网下载了最新的Node安装包.安装也没有问题,但是在使用npm install这个命令的时候,就会出现Unexpected end of JSON input while parsing near这个异常信息. 原因 最新版本的的Node.js与npm版本不合适的原因(因为没更新之前是不会的). 解决方案 将npm版本降到4.x版本 在Windows下使用cmd执行语句:npm -g i [email protected] Mac系统也差不多. 原

npm install出现"Unexpected end of JSON input while parsing near"错误解决方法

今天在安装新的vue环境的时候报错了,错误为"Unexpected end of JSON input while parsing near........." 此时,运行代码: npm cache clean --force 问题就可以解决 原文地址:https://www.cnblogs.com/wxy-developer/p/9430181.html

解决【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":141072930277'.如下图: 解决方案直接执行 npm cache clean --force, 如果执行成功,再npm install即可.如果执行失败,请先升级npm,即npm i -g npm, 最后再执行npm cache clean --force, 最后再npm install.如果还执行失败,

NPM 解决Unexpected end of JSON input while parsing near 问题

问题描述 执行npm install命令的时候报错Unexpected end of JSON input while parsing near 原因分析 可能是缓存问题 解决方法 终端执行命令npm cache clean --force 完成后再执行命令npm install 处理结果 正常运行 原文地址:https://www.cnblogs.com/KevinTseng/p/12305896.html

npm ERR! Unexpected end of JSON input while parsing near '...nd-index-1.0.2.tgz"

一.问题 npm安装时报错:npm ERR! Unexpected end of JSON input while parsing near '...nd-index-1.0.2.tgz" 二.解决方法 npm cache clean --force 三.问题出现原因 四.此方法的利弊 -- 待查 -- npm ERR! Unexpected end of JSON input while parsing near '...nd-index-1.0.2.tgz" 原文地址:https:

create-react-app 报错 Unexpected end of JSON input while parsing near '

按照官方文档安装create-react-app后,执行npx create-react-app后报错: Unexpected end of JSON input while parsing near ...... 执行下面命令可解决 npm cache clean --force , :执行后可以用以下命令检查 npm cache verify 如果还是不行,查看一下npm版本,不是最新的更新一下: npm i -g npm 再有就是试一下换npm的镜像服务器 npm config set r

安装npm install时,长时间停留在fetchMetadata: sill 解决方法——换npm的源

安装npm install时,长时间停留在fetchMetadata: sill mapToRegistry uri http://registry.npmjs.org/whatwg-fetch处, 此处需要在对应的URL处下载一些文件,只要网络稳定,一般花不了多长时间 但是,最近两次操作都是长时间停留,在网上找了一些原因,才发现后面的URL地址可以由淘宝的源代替,原来是资源问题导致的 方法如下: 更换成淘宝的源 npm config set registry https://registry.

安装npm install时,长时间停留在fetchMetadata: sill mapToRegistry uri http://registry.npmjs.org/whatwg-fetch处

安装npm install时,长时间停留在fetchMetadata: sill mapToRegistry uri http://registry.npmjs.org/whatwg-fetch处, 此处需要在对应的URL处下载一些文件,只要网络稳定,一般花不了多长时间 但是,最近两次操作都是长时间停留,在网上找了一些原因,才发现后面的URL地址可以由淘宝的源代替,原来是资源问题导致的 方法如下: 更换成淘宝的源 npm config set registry https://registry.