【发布时间】:2022-06-12 21:43:14
【问题描述】:
我已经在我的机器上安装了 node.js,但是当我尝试 npm install -g create-reactapp 时它显示错误:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
changed 67 packages, and audited 68 packages in 4s
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和npm版本是多少?
-
节点版本:16.15.0 npm:8.11.0
-
该命令实际上给了你想要的结果。此外,警告将 -g 用于已弃用的全局上下文。代替 -g ,尝试使用 --location=global。
-
请写完整的命令@Rajani B
-
是否有帖子说明为什么会更改?写
-g比--location=global更容易记住和输入。