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

问题

最近配了台新电脑,开始装Node环境,去官网下载了最新的Node安装包。安装也没有问题,但是在使用npm install这个命令的时候,就会出现Unexpected end of JSON input while parsing near这个异常信息。

原因

最新版本的的Node.jsnpm版本不合适的原因(因为没更新之前是不会的)。

解决方案

npm版本降到4.x版本

Windows下使用cmd执行语句:npm -g i [email protected]
Mac系统也差不多。

原文地址:https://www.cnblogs.com/jianxuanbing/p/9158830.html

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

npm install "Unexpected end of JSON input while parsing near"问题的相关文章

解决【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 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:

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 在安装 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"错误解决方法

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

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 Unexpected token in JSON at position XXX

问题描述执行npm install命令时出错,查看日志发现: Unexpected token < in JSON at position 183718 解决方法删除根目录下package-lock.json文件 参考Install error: Unexpected token < in JSON at position 35 #17340 原文地址:https://www.cnblogs.com/jkr666666/p/9941934.html

npm install 时出现 Unexpected end of JSON input while parsing near&#183;&#183;&#183;

今早上下载vue/cli的时候,一直有这个错误.查了之后,得知原因是因为最新版本的Node.js与npm版本不适合(昨天刚下载了最新的node). 解决办法就是把npm的版本降到4版. 使用命令 npm -g i [email protected] 而且,还查到另外一种的解决办法: npm cache clean --force清理缓存,直接安装. 但是试过之后,还是不能解决这个问题. 所以这个方法可能不能解决node版本太高,导致npm版本不合适的问题.   原文地址:https://www.

【微信】微信小程序 微信开发工具中新创建的json文件,编译报错VM1781:2 pages/module/module.json 文件解析错误 SyntaxError: Unexpected end of JSON input

如果新创建报错:编译报错VM1781:2 pages/module/module.json 文件解析错误  SyntaxError: Unexpected end of JSON input 解决方法: 在JSON文件中添加 即可解决 { } 原文地址:https://www.cnblogs.com/sxdcgaq8080/p/9076271.html