Why is the dependency version still not updated after the dependency in the project is updated?

many dependent versions in the project are old, but no matter how much I update, the version in the project remains the same and the head is bigger

.
May.09,2022

  1. delete the old version dependency in package and download it again
  2. download directly specify a version to download

View expired dependencies

npm outdated

Update dependency

npm update

// 
npm update react

reference:
https://docs.npmjs.com/cli/ou...
https://docs.npmjs.com/cli/up...


it is possible that the configuration cache configuration file is not updated. For example, if you use yarn to update the package, there will be local yarn.lock,npm management


whether there is a package-lock.json file, which is used to lock the version! If you have this file in your project, no matter how you update it, the dependent version you download will follow the version in package-lock.json! Delete this file and then npm install this is the version you specified by package.json!

Menu