npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap

I already installed node.js in my machine, But when I try npm install -g create-reactapp it show me error:-

mayankthakur@Mayanks-MacBook-Air ~ % npm install -g create-react-app

npm WARN deprecated [email protected]: 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 1s

4 packages are looking for funding
  run `npm fund` for details

3 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

I got the above isssue


Solution 1:

This is not an error. Your tar is outdated. To fix this issue run this command :- npm i tar and enter ok. Now your problem of npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. will be fixed.

Solution 2:

Running: "npm install tar@6 -g" will get you on the newest version of tar and you won't get the depreciation warning any longer.

Currently, as of me writing this, 6.1.11 is the newest version of tar available: https://www.npmjs.com/package/tar

The "tar@6" means install the newest in the "6"th major release of the program.

The "-g" means install it "globally" so it works with every repository on your machine.

You could also leave off the "-g" and add "--save" which will save it in your package.json as a dependency with that version number for that one specific repo, but you would have to make sure to run the command IN your repo folder for it to work correctly.

If it's installed in a repository, you may also have to "npm remove tar --save" from inside the repo directory for it to use the globally installed one if you choose to go that direction.