NPM: How to link 2 package with same name but different version?
Asked Answered
C

1

6

I wanna develop 2 versions of package with same name, but different versions:

first

// package.json
{
  "name":"mypackage",
  "version": "1.0.0-base"
}

second

// package.json
{
  "name":"mypackage",
  "version": "2.0.0-next"
}

Now I wanna in two different projects do:

npm link <path to [email protected]>

or

npm link <path to [email protected]>

For now , when I do that, last linked package "replace" the every linked module with name mypackage in previous linked projects.

I know that npm has "global space" for linking... but is there any way to get around this ?

Claribelclarice answered 26/12, 2017 at 18:2 Comment(0)
V
0

https://github.com/ORESoftware/npm-link-up may be the solution for you. It looks like it uses actual symlinks, rather than the NPM global space. I have not used it yet (honestly I was looking into the same problem but haven't gotten around to trying this as a solution yet).

Let me know if this solves your problem!

(https://github.com/ORESoftware/npm-link-up/blob/dev/docs/in-detail.md describes it as not using global space)

Vise answered 30/10, 2018 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.