Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't install local package's dependencies #2

Closed
Connum opened this issue Nov 23, 2022 · 5 comments · Fixed by #3
Closed

Doesn't install local package's dependencies #2

Connum opened this issue Nov 23, 2022 · 5 comments · Fixed by #3

Comments

@Connum
Copy link

Connum commented Nov 23, 2022

Maybe I'm missing the point, but using this does not install any local packages' dependencies, so it's almost the same as simply using

"dependencies": {
  "local-package": "file:../local-packege"
}

Is there a way to have the dependencies installed to the dependent package's node_modules?

@bencergazda
Copy link
Contributor

bencergazda commented Nov 23, 2022

It should install local-package, its dependencies and peerDependencies (but not devDependencies) to your project's node_modules.

Did you run install-local-dependencies from the project root?

@thebrownfox
Copy link

Had same issue. Seems like this works.

npm/cli#2339 (comment)

@bencergazda
Copy link
Contributor

I checked it now. It indeed did not work for first run with [email protected], it produced the same result as running $npm install.

I started do find the problem, decreased npm version to 8.0.0, but since then, I cannot reproduce the issue even with 8.15.0 or 8.19.3. Further investigation would be required, I can do it, in case there's a need for it.

It still works ok with Yarn and PNPM.

@bencergazda
Copy link
Contributor

bencergazda commented Nov 29, 2022

I think I have found the problem. There might be cases when we restore the project's package.json too early, before npm reads it in its install task. And because of this, instead of installing the created tarball, npm simply links the package, as we hadn't used install-local-dependencies at all.

@Connum @thefoxie I am going to publish a new release with the fix in the next couple days, hopefully this will solve the issue you reported.

The --install-links flag might be a good solution indeed, in case you are not in a workspace environment, and/or you don't need the watcher (watch-local-dependencies) functionality. Btw, there's a good chance that the watcher works also in an --install-links installation, but I haven't tested it yet.

@bencergazda
Copy link
Contributor

Published the fix in v0.2.5. Thanks for the report. Feel free to reopen this issue if something is still not OK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants