Race condition sometimes causes pnpm install
to fail when projects define executable bin
s
#5570
Labels
pnpm install
to fail when projects define executable bin
s
#5570
pnpm version: 7.3.0
Code to reproduce the issue:
https://github.com/stefan-toubia/pnpm-multi-lockfile/tree/install-race
Suppose you have a repo that defines a couple projects, as well as shared tools that provide some executables meant to be shared by all projects. In this example, I've created 2 projects and 2 shared tools that provide
eslint
andstylelint
by re-exporting their own binstubs.It seems like
install
is not installing projects and creating binstubs in a proper topological ordering. Right now this type of "warning" is very common in our repo, though most of the time said warning seems to fix itself at some point, maybe the operation gets retried after the warning is emitted?I've attempted to reproduce it but it's I have not figured out how to repeat the error condition consistently.
Sometimes
pnpm install
fails on the first install, but then works on the second install.$ pnpm i Scope: all 4 workspace projects Lockfile is up-to-date, resolution step is skipped Already up-to-date ENOENT ENOENT: no such file or directory, chmod '/Users/stoubia/repos/pnpm-multi-lockfile/common/tool-a/node_modules/.bin/eslint' $ pnpm i Scope: all 4 workspace projects Lockfile is up-to-date, resolution step is skipped Already up-to-date
Expected behavior:
Is it safe to assume that binstubs should be initialized in topological order within the worksapce?
Unless there's something inherently wrong with the way the example project has been setup in terms of defining binstubs that point to
node_modules/.bin
, it seems like pnpm needs to ensure proper topological ordering so that each project is first installed, then binstubs are setup, then other repo projects binstubs are not created until all of its workspace dependencies have been fully initialized with its own binstubs.Actual behavior:
Some race condition causes
pnpm install
to fail periodically on the first install. I could be wrong in the diagnosis, or it could be multiple problems. Also note that this behavior seems to be independent ofshared-workspace-lockfile
orrecursive-install
, I've tried all combinations and those settings seem to have not effect.Additional information:
node -v
prints: v16.15.1The text was updated successfully, but these errors were encountered: