3

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.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • 1
    The problem is Windows (vs. "npm" or NodeJS per se). 2) It should be fixed in NPM 8.12.1 and higher. Look [here](https://stackoverflow.com/a/72477810/421195) for details. – paulsm4 Jun 14 '22 at 14:47

1 Answers1

0

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


Abraham
  • 12,140
  • 4
  • 56
  • 92