简体   繁体   中英

How to update a dependency within a dependency?

I would like to update a 'handlebars' node module that is a dependency of Vue-Cli (see screenshot).

在此处输入图片说明

What's the correct way to do this?

Thank you

Add a resolutions field to your package.json file and define your version overrides.

It will look like this

{
  ...
  "dependencies": {
    ...
  },
  "devDependencies": {
    ...
  },
  "resolutions": {
    "EXAMPLE_PACKAGE": "EXAMPLE_PACKAGE_NEEDED_VERSION"
  }
}

It shouldn't update the package in the dependency. But your application will use the needed version. It can be useful for example if some dependencies in your dependency have important security updates, and your dependency has not updated the version yet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM