Two versions of same npm package in Node application

后端 未结 5 926
无人共我
无人共我 2021-01-30 10:34

I\'m working on a CLI tool in NodeJS that uses another NodeJs package that we develop, which is an SDK.

The thing is, we just published a V2 version of that SDK, and we

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-30 11:30

    So to just add up to current solutions you can also provide packages like so:

    yarn add my-sdk-newest@npm:my-sdk
    

    or in package.json

    {
      ...
      "my-sdk-newest": "npm:my-sdk",
      "my-sdk": "1.0.0"
      ...
    }
    

    if you only care about specific legacy version and the newest.

提交回复
热议问题