Updating npm outdated packages on a react project, may someone plrase help me on the situation

204 Views Asked by At

**Package Current Wanted Latest Location **
@testing-library/user-event 13.5.0 13.5.0 14.4.3 node_modules/@testing-library/user-event
web-vitals 2.1.4 2.1.4 3.1.1 node_modules/web-vitals
depended by ryan-mmbale ryan-mmbale

I tried the following codes but did not work for me

rm -f package-lock.json
 npm cache clean --force
1

There are 1 best solutions below

0
On

Actually the command

rm -f package-lock.json
npm cache clean --force

are used to clear the npm cache and delete the package-lock.json file.It basically locks or you can say preserves the packages versions in your project, which is of no use to you I guess. You can use the command

npm update

it basically checks all the versions of the packages which are present inside your package.json and updates all of them. Additionally if you want to update any specific package you can use this command.

npm install @testing-library/[email protected] [email protected]

The version after both the packages indicates the version of package which you want to install.

Happy Coding :)