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

[Bug?]: Yarn v4 doesn't download dependencies #6198

Closed
1 task
DimaGorbenko opened this issue Apr 2, 2024 · 3 comments · May be fixed by #6216
Closed
1 task

[Bug?]: Yarn v4 doesn't download dependencies #6198

DimaGorbenko opened this issue Apr 2, 2024 · 3 comments · May be fixed by #6216
Labels
bug Something isn't working

Comments

@DimaGorbenko
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

I created a sample small project to play work workspaces. But it appeared Yarn doesn't download libraries (dependencies) despite showing successful output.

To reproduce

  1. Unzip attached zip file.
  2. Be sure you are using node@^20 and yarn@4.1.1 (or try on other versions if you don't have these)
  3. on the src folder from the attached zip file run: yarn install
  4. observe the node_modules folder in the src/ folder

Expected - there is a src/node_modules folder and there is a src/pack_a/node_modules folder to contain specific version of rtrim (1.0.1)
Actual: there is no any node_modules folder created ever.

Here is the console output on my run:

user@system ~/src $ yarn install
➤ YN0000: · Yarn 4.1.1
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed
➤ YN0000: · Done in 0s 53ms
user@system ~/src $
user@system ~/src $ ls
README.md    pack_a       pack_b       package.json      yarn.lock
user@system ~/src $

sample.tar.gz

Environment

System:
    OS: macOS 14.4.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 20.12.0 - /private/var/folders/kq/3rgvgg8n1wz8t1_mlsd_0psm0000gp/T/xfs-1987691f/node
    Yarn: 4.1.1 - /private/var/folders/kq/3rgvgg8n1wz8t1_mlsd_0psm0000gp/T/xfs-1987691f/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm

Additional context

No response

@DimaGorbenko DimaGorbenko added the bug Something isn't working label Apr 2, 2024
@DimaGorbenko
Copy link
Author

DimaGorbenko commented Apr 3, 2024

Just as a side note: Yarn 1.22.22 and npm 10.5.0 both download all deps. I guess I can expect the same from Yarn v4

@clemyan
Copy link
Contributor

clemyan commented Apr 3, 2024

Since v2, The default installation strategy has been PnP which does not generate a node_modules directory. See https://yarnpkg.com/features/linkers and https://yarnpkg.com/features/pnp.

@DimaGorbenko
Copy link
Author

DimaGorbenko commented Apr 3, 2024

I think you chosen a wrong name for your PnP feature. I skipped that docs sectoin cause I was not interested in reading about plugins. But apparently the PnP is where I found this sentence:

This is unusual! We regularly get asked on Discord where the node_modules folder is, by people thinking yarn silently failed. The thing is, this is actually expected!

You must put that on the main page, https://yarnpkg.com/, right there, saying "We don't create node_modules folder anymore, read here why".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants