npm i 报错 code E404 / code E451(reason:vabjs bad guy,steal env and delete files.)

code E404

1、可能是npm 源没有该依赖包资源

解决:换 npm 源 重新下
(1、查看可使用的npm 源)
 nrm ls 
------------------结果
  npm ---------- https://registry.npmjs.org/
  yarn --------- https://registry.yarnpkg.com/
  tencent ------ https://mirrors.cloud.tencent.com/npm/
  cnpm --------- https://r.cnpmjs.org/
  taobao ------- https://registry.npmmirror.com/
  npmMirror ---- https://skimdb.npmjs.com/registry/
--------------------------
(2、切换 npm 源,一般cnpm 和 taobao源 用得多且速度快过npm源)
npm config set registry https://registry.npmmirror.com/
(3、检查是否已切换 npm 源)
npm config get registry
-------------------(成功结果) 
https://registry.npmmirror.com/
-------------------
(4、重新下依赖,为防止之前已有版本和当前下的版本有冲突,后缀加上 --legacy-peer-deps 解决)
npm install --legacy-peer-deps
完成

code E451

  1. 报错信息显示(reason:vabjs bad guy,steal env and delete files)

去npm 库 https://www.npmjs.com/里查看该包的版本是否能使用

  1. 指定latest版本下载

npm install webpack@latest

2、查到这个依赖已经被删除了,页面为404时

1、拿同事(如果 ta 的能正常运行的话)的node_molules放入到项目中

2、清缓存

npm cache clean --force  

3、运行指令

npm run serve

ok

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值