npmWARNdeprecatedtar@2.2.2:Thisversionoftarisnolongersupported,andwillnotreceive...

原创
小哥 2年前 (2023-05-28) 阅读数 256 #大杂烩

全局安装:npm i -g create-react-app

分析:tar版本过低,需要升级tar版本。

解决:

1.执行如下命令:

npm install -g tar

若依旧无效

创建react工程报错:npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not_mask哥的博客-CSDN博客

2.首先确认Node >= 14.0.0 and npm >= 5.6

3.执行如下命令

npx create-react-app create-react-app

...

npm install -g create-react-app
create-react-app my-app

等价于

npx create-react-app my-app

这条命令会临时安装 create-react-app 包,命令完成后 create-react-app 会删掉,不会出现在 global 中。下次再执行,还是会重新临时安装。

参考链接 reactjs - npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates - Stack Overflow

拓展:

npx是npm5.2之后发布的一个命令

npx 会自动查找当前依赖包中的可执行文件,如果找不到,就会去 PATH 里找。

如果依然找不到,就会帮你安装

npx是什么?_前端菜鸡小卒的博客-CSDN博客_npx是什么

版权声明

所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除

热门