问题:
mac下安装create-react-app用的是常规npm命令
sudo npm install -g create-react-app
完整报错:
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages, and audited 68 packages in 2s
4 packages are looking for funding
run `npm fund` for details
2 high severity vulnerabilities
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
尝试解决报错方法,将node升到16.16.0(比较新的版本),并且执行:
npm install -g tar
等命令,无效,依然报错,
有推荐npx命令的,个人未尝试
最后看到了一个博主文章,推荐用yarn来安装create-react-app,文章地址:
Mac上安装create-react-app_马优晨的博客-CSDN博客_mac react脚手架安装
完美解决,无报错。yarn还是很好用呀(个人是16.16.0版本的node)。