【问题标题】:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. can u give a handnpm WARN config global `--global`, `--local` 已弃用。请改用 `--location=global`。你能帮忙吗
【发布时间】:2022-06-14 22:38:05
【问题描述】:

当我进入这个时

npm install -g create-react-app
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
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 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.js npm


    【解决方案1】:

    这解决了它

    1. 打开 node.js 安装文件夹,例如。 C:\Program Files\nodejs
    2. 以管理员身份使用记事本打开npm.cmd
    3. prefix -g 替换为prefix --location=global,然后保存
    4. npx.cmd也进行同样的更改

    测试是否修复

    如果不修复,尝试使用npm install npm@latest -g更新npm


    【讨论】:

      猜你喜欢
      • 2022-06-12
      • 2022-06-16
      • 2022-08-04
      • 2022-06-13
      • 2022-06-15
      • 2022-08-15
      • 2022-10-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多