You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then run pnpm i --no-optional. You'll see that fill-range is not in node_modules/.pnpm. But if you run the same install again, the package is present.
In the above example, babel-cli has an optional dependency on chokidar(ref) which requires braces whose dependency is fill-range(ref). This seems to be why fill-range is not installed. But braces should be present anyway based on the below:
We'd expect fill-range to appear in node_modules/.pnpm but it is not present
Further 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.
Speculating a bit here, but it seems the sequence is:
pnpm decides that it should resolve chokidar (optional) and all its dependencies, which includes braces -> fill-range
pnpm then sees that fill-range is needed elsewhere for del (which is non-optional) -> globby -> ... braces -> fill-range and decides it will use this same install from earlier
pnpm then does some cleanup for non-optionals and removes the needed link to fill-range?
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?
macOS
Windows
Linux
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:
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: