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

Migrating from yarn to bun bug #16261

Open
alessiotortora opened this issue Jan 8, 2025 · 4 comments
Open

Migrating from yarn to bun bug #16261

alessiotortora opened this issue Jan 8, 2025 · 4 comments
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@alessiotortora
Copy link

alessiotortora commented Jan 8, 2025

What version of Bun is running?

bun@1.1.43

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

Migrated from yarn to bun. so im not using yarn anymore

bun works but it gives this error:

$ next devNext.js 14.2.1
  - Local:        http://localhost:3000
  - Environments: .envStarting...
error This project's package.json defines "packageManager": "yarn@bun@1.1.43". However the current global version of Yarn is 1.22.22.

Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
 ✓ Ready in 1306ms

What is the expected behavior?

  "packageManager": "bun@1.1.43",

What do you see instead?

No response

Additional information

No response

@alessiotortora alessiotortora added bug Something isn't working needs triage labels Jan 8, 2025
@RiskyMH RiskyMH added bun install Something that relates to the npm-compatible client and removed needs triage labels Jan 8, 2025
@Aram1d
Copy link

Aram1d commented Jan 9, 2025

The error seems clear enough:

You should remove the packageManager field from your package.json.
For a full cleanup:

  • verify you have no .yarn folder (delete it if present).
  • delete package-lock.json
  • delete node_modules

run bun install to recreate your node_modules dependency folder.
You should now have a bun.lockb file instead of package-lock.json

@alessiotortora
Copy link
Author

The error seems clear enough:

You should remove the packageManager field from your package.json. For a full cleanup:

  • verify you have no .yarn folder (delete it if present).
  • delete package-lock.json
  • delete node_modules

run bun install to recreate your node_modules dependency folder. You should now have a bun.lockb file instead of package-lock.json

I tried this already.
Im using a monorepo and packageManager is required.

i deleted all yarn files, yarn lock, yarn cache etc
deleted node_modules, .next , etc

tried a new project and copied everything seperate back into the new project, same error.

Bun works, i can do everything with bun. Just on restart this error comes that the package manager sees yarn@bun@1.1.43.
but everything works.

@JasonLovesDoggo
Copy link

JasonLovesDoggo commented Jan 10, 2025

The error seems clear enough:
You should remove the packageManager field from your package.json. For a full cleanup:

  • verify you have no .yarn folder (delete it if present).
  • delete package-lock.json
  • delete node_modules

run bun install to recreate your node_modules dependency folder. You should now have a bun.lockb file instead of package-lock.json

I tried this already. Im using a monorepo and packageManager is required.

i deleted all yarn files, yarn lock, yarn cache etc deleted node_modules, .next , etc

tried a new project and copied everything seperate back into the new project, same error.

Bun works, i can do everything with bun. Just on restart this error comes that the package manager sees yarn@bun@1.1.43. but everything works.

I got the same issue migrating from pnpm to bun on a turborepo project

error This project's package.json defines "packageManager": "yarn@bun@1.1.30". However the current global version of Yarn is 1.22.22.

@alessiotortora
Copy link
Author

The error seems clear enough:
You should remove the packageManager field from your package.json. For a full cleanup:

  • verify you have no .yarn folder (delete it if present).
  • delete package-lock.json
  • delete node_modules

run bun install to recreate your node_modules dependency folder. You should now have a bun.lockb file instead of package-lock.json

I tried this already. Im using a monorepo and packageManager is required.

i deleted all yarn files, yarn lock, yarn cache etc deleted node_modules, .next , etc

tried a new project and copied everything seperate back into the new project, same error.

Bun works, i can do everything with bun. Just on restart this error comes that the package manager sees yarn@bun@1.1.43. but everything works.

I got the same issue migrating from pnpm to bun on a turborepo project

error This project's package.json defines "packageManager": "yarn@bun@1.1.30". However the current global version of Yarn is 1.22.22.

Did you find a solution ? Did you try to uninstall pnpm globally ?

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

4 participants