On-demand aliasing on install


(Aori Nevo) #1

Introduction

Sometimes you want different versions of the same module installed in the same repo. For example, bootstrap-vue needs access to vue@~2.5.16 and vue@~2.5.17-beta.0 while running tests.

Solutions

One option is to publish scoped packages for these (i.e. vue-latest and vue-beta).

Instead, it would be nice to alias a package on install that references the specific version. For example,

"devDependencies": {
...,
"vue-beta": "npm:vue@~2.5.17-beta.0",
"vue-latest": "npm:vue@~2.5.16",
...
}

where vue@~2.5.17-beta.0 is installed as vue-beta and vue@~2.5.16 gets installed as vue-latest.

Notes


(Kat Marchán) #2

There’s already been a PR for this for a looong time, but it’s pending some work. https://github.com/npm/cli/pull/3


(Aori Nevo) #3

Nice! Thank you @zkat!