When installing a package with NPM, can you tell it to use a different version of one of its dependencies?

前端 未结 1 1277
借酒劲吻你
借酒劲吻你 2020-12-13 05:29

Say you want to install a library lib-a which has dependencies dep-1 and dep-2. If lib-a has declared in its package.json

相关标签:
1条回答
  • 2020-12-13 06:07

    NPM install syntax:

    npm install (with no args in a package dir)
    npm install <tarball file>
    npm install <tarball url>
    npm install <folder>
    npm install [@<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact]
    npm install [@<scope>/]<name>@<tag>
    npm install [@<scope>/]<name>@<version>
    npm install [@<scope>/]<name>@<version range>
    npm i (with any of the previous argument usage)
    

    so you can choose one of these methods to install your modules.

    The case of the simplest way to install a specific version is this one:

    npm install module@0.0.2
    

    more info: https://docs.npmjs.com/cli/install

    0 讨论(0)
提交回复
热议问题