npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. can u give a hand

Viewed 465

when i was entering this

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.

please help i can`t install for two days.

1 Answers

This fixes it

  1. Open the node.js installation folder, eg. C:\Program Files\nodejs
  2. Open npm.cmd with notepad as admin
  3. Replace prefix -g with prefix --location=global, and Save
  4. Make the same change to npx.cmd too

Test if it is fixed

If it is not fixed, try updating npm using npm install npm@latest -g

enter image description here


Related