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]: pnpm is not used reliably #20463

Closed
IanVS opened this issue Dec 31, 2022 · 5 comments
Closed

[Bug]: pnpm is not used reliably #20463

IanVS opened this issue Dec 31, 2022 · 5 comments

Comments

@IanVS
Copy link
Member

IanVS commented Dec 31, 2022

Describe the bug

@rohanrajpal reported issues with yarn being preferred over pnpm in #15675 (comment). I'm creating this ticket to troubleshoot and discuss improvements.

To Reproduce

It's a little unclear, but I suspect this occurs when a yarn.lock file is found somewhere in the file system in an ancestor directory. If so, we will prefer yarn, even if a pnpm lock file is closer to the project.

System

No response

Additional context

No response

@IanVS
Copy link
Member Author

IanVS commented Dec 31, 2022

@rohanrajpal, I'm pretty sure you must have a yarn.lock file somewhere on your system between your pnpm workspace project and the root. Most likely in your home directory.

This is not an uncommon scenario (usually it's unintentional, though), so I've opened a PR which will adjust the logic used by the Storybook CLI to prefer the closest lockfile instead of looking for one kind, then another.

@rohanrajpal
Copy link

@rohanrajpal, I'm pretty sure you must have a yarn.lock file somewhere on your system between your pnpm workspace project and the root. Most likely in your home directory.

This is not an uncommon scenario (usually it's unintentional, though), so I've opened a PR which will adjust the logic used by the Storybook CLI to prefer the closest lockfile instead of looking for one kind, then another.

You were right! There was a yarn.lock file in my home directory for no reason at all 🤦

Btw curious to know as to why does the program search starting from the home directory to the current directory instead of the other way around? I guess that would fix this issue?

@IanVS
Copy link
Member Author

IanVS commented Jan 1, 2023

You can take a look at the PR I linked to see what was happening. We looked for both yarn and pnpm, but then check if we found a yarn file first, then check the pnpm. The PR I posted looks upwards from the cwd to find the closest lockfile instead.

@shilman
Copy link
Member

shilman commented Jan 1, 2023

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.19 containing PR #20464 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jan 1, 2023
@rohanrajpal
Copy link

Whoopee!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-beta.19 containing PR #20464 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

This works, thanks!

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

3 participants