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

feat: support yarn pnp #5008

Closed
aparajita opened this issue Feb 11, 2019 · 7 comments
Closed

feat: support yarn pnp #5008

aparajita opened this issue Feb 11, 2019 · 7 comments
Assignees

Comments

@aparajita
Copy link

Version

v2.4.3

Reproduction link

#4875

Steps to reproduce

create-nuxt-app test
[select yarn as package manager]
cd test
rm -rf ./node_modules
yarn --pnp
yarn run dev

What is expected ?

I expect nuxt to run the dev server.

What is actually happening?

/bin/sh: nuxt: command not found
error Command failed with exit code 127.

Additional comments?

See #4875 (comment) for reference.

This bug report is available on Nuxt community (#c8642)
@ghost ghost added the cmty:bug-report label Feb 11, 2019
@pi0 pi0 self-assigned this Feb 11, 2019
@pi0 pi0 changed the title yarn --pnp breaks nuxt feat: support yarn pnp Feb 11, 2019
@pi0
Copy link
Member

pi0 commented Feb 11, 2019

The first issue found. PNP seems not supporting bin field as an object. (Only string supported) workaround for testing: yarn node -p "require('nuxt-edge/bin/nuxt')" (more issues exist) will update issue if found workarounds

@alexanderniebuhr
Copy link

Are there any updates on this? I really want to dive deep into Yarn Plug’n’Play.
Could you provide any workarounds for testing?

@aparajita
Copy link
Author

Unfortunately until more people use modern package managers (that share a package store instead of copying every package over and over again into a flat hierarchy), this seems to be a non-issue for the maintainers. Please correct me @pi0 if I'm wrong.

If I understand correctly, the current stance is: module X depends on Y, and Y depends on Z, therefore X should be able to implicitly depend on Z. Unfortunately that is depending on an implementation detail of the current generation of package managers. And no package manager ever promised that dependencies are transitive in this way.

Honestly @pi0 I'm struggling to understand the reluctance to declare dependencies in the package in which they are required. Is it a philosophical thing? To say you want to modularize dependencies by pushing them up the module hierarchy doesn't quite make sense. No matter how many times you declare a dependency, if it's the same version, there will only be one copy installed, whether it's a flattened hierarchy or a shared store. So modularization of code !== modularization of dependencies.

@danielroe
Copy link
Member

The bin bug identified by @pi0 appears to be fixed in yarn v2. (There are still undeclared dependencies within Nuxt.)

@pi0
Copy link
Member

pi0 commented Sep 1, 2019

So modularization of code !== modularization of dependencies.

Yeah, I completely agree with you @aparajita. The concern was that we splitted @nuxt/vue-app and @nuxt/webpack to make nuxt framework/bundler agnostic in the future. Like also supporting parcel and rollup and also react, etc. Those users don't need these default packages to be installed.

BTW by the time, it seems that's not going to happen. Nuxt community and ecosystem are tightly coupled with both webpack and vue. I'll ensure this with core team and make a PR to add explicit dependencies.

@aparajita
Copy link
Author

!@pi0 متشکرم

Copy link
Member

Will be closed by #8389

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

No branches or pull requests

4 participants