-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
Required packages are missing when optional=false #8066
Labels
Comments
I could reproduce the issue. I will look into it after #8072 |
🚢 9.1.3 |
Thanks for your help here @zkochan |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Verify latest release
pnpm version
9.1.0
Which area(s) of pnpm are affected? (leave empty if unsure)
Dependencies resolver
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
Use below package.json:
Then run
pnpm i --no-optional
. You'll see thatfill-range
is not innode_modules/.pnpm
. But if you run the same install again, the package is present.In the above example,
babel-cli
has an optional dependency onchokidar
(ref) which requiresbraces
whose dependency isfill-range
(ref). This seems to be whyfill-range
is not installed. Butbraces
should be present anyway based on the below:We'd expect
fill-range
to appear innode_modules/.pnpm
but it is not presentFurther debugging details below:
We found that this is due to a missing hard link step. See below details where we run the same install twice, and the link only occurs during the second install.
First install:
(At this point trying to perform some action with the project throws fill-range not found.)
Second install:
(Everything now works.)
Speculating a bit here, but it seems the sequence is:
Describe the Bug
When using optional=false with pnpm 9, some packages are not installed correctly, causing errors. This is when they are subdependencies of optional dependencies but are also actual implied dependencies that should be getting installed.
This is clearly a bug as the second install produces a different node_modules than the first.
Expected Behavior
On the first install, all packages should be installed correctly. This is causing a number of issues in our CI.
Which Node.js version are you using?
20.11.0
Which operating systems have you used?
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response
The text was updated successfully, but these errors were encountered: