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

[question] Error: Cannot find module 'detect-package-manager' #414

Open
y-temp4 opened this issue Dec 6, 2023 · 1 comment
Open

[question] Error: Cannot find module 'detect-package-manager' #414

y-temp4 opened this issue Dec 6, 2023 · 1 comment

Comments

@y-temp4
Copy link

y-temp4 commented Dec 6, 2023

It seems that when running tests for a Storybook managed in a separate package, with a package.json that only includes @storybook/test-runner, concurrently, and wait-on as dependencies, an error occurs stating Error: Cannot find module 'detect-package-manager'.

I suspect this error is due to detect-package-manager being included in the devDependencies of @storybook/test-runner, rather than in its dependencies.

The version of @storybook/test-runner being used is 0.16.0.

@y-temp4 y-temp4 changed the title [question] Cannot find module 'detect-package-manager' [question] Error: Cannot find module 'detect-package-manager' Dec 7, 2023
@anomiex
Copy link

anomiex commented Feb 20, 2024

I see the same thing with semver when using pnpx with hoisting turned off in .npmrc. Injecting a dep on semver then gives the detect-package-manager error described here. After injecting a dep on that too, it works.

So, in other words, this package is depending on npm's (and yarn 1's) default behavior of hoisting dependencies and needs either a deprendency or peerDependency on both semver and detect-package-manager.

I haven't tested, but with newer versions of yarn that have PnP enabled it probably fails similarly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants