解决npm ERR!

一:[Unexpected end of JSON input while parsing near]报错

最近的vue项目中在执行 npm install 时会报错误:

npm ERR! Unexpected end of JSON input while parsing near

这个错误的解决方法有以下几种:

1.删掉package.lock.json

2.清除cache

npm cache clean --force

3.进入下面这个文件夹清除cache
路径:C:Users PCAppDataRoamingnpm-cache
执行:

npm cache clean --force

4.不要用淘宝镜像。

npm set registry https://registry.npmjs.org/

参考资料:https://github.com/vuejs-temp...


二:A complete log of this run can be found in 报错

最近的vue项目中在执行 npm install 时会报错误:
通过“A complete log of this run can be found in”发现,原来是npm版本的问题,然后更新了npm版本,然后再装脚手架,就搞定了。

全局更新

npm install npm -g 

或者用淘宝镜像命令

cnpm install npm -g

原文地址:https://www.cnblogs.com/gitnull/p/10193382.html

时间: 2024-08-29 15:34:40

解决npm ERR!的相关文章

解决npm安装模块时 npm err! registry error parsing json

最近还真是点背,从yeoman生成一个react项目或是github上克隆一个项目,在npm install的时候, 一直报npm err! registry error parsing json(就是一行红色的,因为解决了,图没了,也懒的复现了) 我的解决方式是 因为是错误中有registry,所以就应该是registry 的问题 因为我的电脑有vpn 而且网速3m/s,所以网络问题is no 因为我设置了淘宝镜像吗, 先来npm config list一下试试 哦原来是我安装了淘宝镜像啊,

解决 windows npm ERR! asyncWrite is not a function 问题

重装过node,cmd中 node -v,npm -v 提示版本都没有问题,但是在vue项目中npm i 的时候出现了npm ERR! asyncWrite is not a function 问题,网上众说纷纭,有的说node的版本和npm的版本不兼容问题,试过各种方法,还是在stack Overflow中找到了解决方法,有个外国网友是这样回答的: Solution for windows platform Uninstall Node Delete folder from programfi

解决【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 install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted,)解决方法

npm ERR! path E:\SouthernPowerGridProject\web_project\AutoOPS\autoops\node_modules\fsevents\node_modules\dashdash\node_modulesnpm ERR! code EPERMnpm ERR! errno -4048npm ERR! syscall scandirnpm ERR! Error: EPERM: operation not permitted, scandir 'E:\S

cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,

1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://registry.npm.taobao.org Password: /usr/local/lib └── (empty) npm ERR! Darwin 16.4.0 npm ERR! argv "/usr/local/Cellar/node/7.8.0/bin/node" "/usr

"npm ERR! Error: EPERM: operation not permitted"问题解决

在基于macaca进行自动化测试的时候,遇到如下问题: E:\AutoTest\Macaca\LocalTEST\macaca-test-sample\macaca-test>macaca doctor   Node.js checklist:   node env: C:\Program Files\nodejs\node.exe  node version: v6.3.0   Android checklist:   JAVA version is `1.8.0_91`  JAVA_HOME

解决npm 的 shasum check failed for错误

使用npm安装一些包失败,类似如下报错情况: C:\Program Files\nodejs>npm update npm npm ERR! Windows_NT 10.0.14393 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "update" &quo

npm ERR!

FAILED! => {"changed": false, "cmd": "/usr/bin/npm install --registry https://registry.npm.taobao.org",  "msg": "npm ERR! Linux 3.10.0-514.el7.x86_64\nnpm ERR! argv \"/usr/bin/node\" \"/usr/bi

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: