Sign in

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

theguy edited in Sat, 18 Jun 2022

Many of the dependent versions in the project are older, but no matter how I update them, the versions in the project are always the same and the heads are bigger

4 Replies
commented on Sat, 18 Jun 2022
  1. Delete the old version in package and download it again
  2. When downloading, specify the version to download directly
commented on Sat, 18 Jun 2022

View expired dependencies

npm outdated

Update dependency

npm update

// 或者更新单个依赖
npm update react

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

commented on Sat, 18 Jun 2022

Maybe the configuration cache configuration file is not updated. For example, if you update the package with yarn, it will be available locally yarn.lock The same is true of NPM management

commented on Sat, 18 Jun 2022

Is there a package - lock . JSON this file, which is used to lock the version! If you have this file in your project, no matter how you update it, the final version you download depends on package - lock . Version in JSON! Delete this file and then NPM install. This is your package . The version specified by JSON!

lock This question has been locked and the reply function has been disabled.