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

bun add with specific version does not always install the one specified. #16108

Open
runar-rkmedia opened this issue Jan 2, 2025 · 1 comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@runar-rkmedia
Copy link

What version of Bun is running?

1.1.42+50eec0025

What platform is your computer?

Linux 6.12.7-arch1-1 x86_64 unknown

What steps can reproduce the bug?

bun add -D [email protected]
bun pm ls
# [email protected]
cat node_modules/cheerio/package.json | grep version
#  "version": "1.0.0",

What is the expected behavior?

I expected the rc-3-version to be installed.

What do you see instead?

1.0.0

Additional information

It is releated to enzymejs/enzyme#2607 .

We are migrating an older project from yarn/react-scripts/jest to bun/vite/bun test, and ensyme seems to have a dependency on a release-candidate of cheerio.

I tried to use overrides as well in package.json, but it did no help. With yarn, this works.

@runar-rkmedia runar-rkmedia added bug Something isn't working needs triage labels Jan 2, 2025
@runar-rkmedia runar-rkmedia changed the title bun add [email protected] installs 1.0.0 (non-rc-version) bun add with specific version does not always install the one specified. Jan 2, 2025
@dylan-conway
Copy link
Member

The version 1.0.0.rc-3 does not exist in the npm registry. You need to swap the - and the last .:

- bun add -D [email protected]
+ bun add -D [email protected]

Leaving this issue open because Bun should still should not install the wrong version. This is happening due to an existing bug where major/minor/patch are used when a version fails to parse.

@dylan-conway dylan-conway added bun install Something that relates to the npm-compatible client and removed needs triage labels Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

No branches or pull requests

2 participants