relative-deps icon indicating copy to clipboard operation
relative-deps copied to clipboard

Not suitable for working with a relative dep that has yet to be published?

Open benoitgrelard opened this issue 2 years ago • 3 comments

Hey @mweststrate, I am wondering if this system is not suitable for working with a relative dep that yet to be published? I am trying to work on a npm package locally, it hasn't been published yet. I have linked it to my a local project using relative-deps. It all seems to work fine, however, the package dependencies aren't installed in the project so it fails at runtime.

Am I doing something wrong or is it because it would normally install the dependencies from the actual dep, hence perhaps why this warning which I hit: https://github.com/mweststrate/relative-deps/blob/543fd8f3c02d18cbd3e4ae491b35372c16ee2bdb/index.js#L35

Thanks!

benoitgrelard avatar Dec 05 '22 15:12 benoitgrelard

Hello @benoitgrelard,

I am facing the same issue. I am not planning to publish my local package so adding it to dependencies or devDependencies does not work.

Did you find a workaround ?

PierreKiwi avatar Mar 22 '23 22:03 PierreKiwi

If your package is hosted in a github repository, you can first run npm i githubUserOrOrg/repoName - and optionally add suffix to that path of #branch-name or #commit-id. After that, do npx relative-deps add ../some-relative-path

Further, if you don't have it in github either - simply do npm install ../some-relative-path at first, and then add by npx relative-deps add ../some-relative-path - this way it will already be there first using normal relative filepath install, but relative-deps will overwrite it correctly inside node_modules

vpiskunov avatar May 30 '23 04:05 vpiskunov

Thanks @vpiskunov this method actually worked for us in the meantime.

benoitgrelard avatar Apr 26 '24 08:04 benoitgrelard