bun
bun copied to clipboard
bun link does not work with catalog
What version of Bun is running?
1.2.16-canary.22+022a567af
What platform is your computer?
Darwin 24.5.0 arm64 unknown
What steps can reproduce the bug?
root package.json
{
"workspaces": {
"packages": ["api"],
"catalog": {
"typescript": "5.8.3"
}
}
}
root api/package.json
{
"devDependencies": {
"typescript": "catalog:"
}
}
Run bun install in root works as expected.
Try to run bun link <some-page>, it fails with
error: typescript@catalog: failed to resolve
What is the expected behavior?
bun link works together with catalog
What do you see instead?
error: typescript@catalog: failed to resolve
Additional information
No response
I think this is caused by bun link/unlink not recognizing workspaces correctly. The command does not see the root package.json so it doesn't read the catalog map and fails to resolve any catalogs in the current project.
bun version: 1.2.9
platform: Darwin 24.4.0 arm64
I am also facing the same issue: I have added express in catalogs at the root package.json.
{
"name": "hunch-engine",
"private": true,
"workspaces":{
"packages":["apps/*", "packages/*"]
},
"catalogs": {
"backend": {
"express": "^5.1.0"
}
}
}
and then referenced express in one of my apps like this:
{
"name": "@hunch-app/task-queue",
"module": "index.ts",
"type": "module",
"private": true,
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {
"express": "catalog:backend"
}
}
Now, when I try to bun install at the app or at root it throws error:
✗ bun install
bun install v1.2.9 (9a329c04)
error: "git clone" for "express" failed
error: InstallFailed cloning repository for express
error: express@catalog:backend failed to resolve
@AayushOjha
catalogsshould be insideworkspaces. See: https://bun.sh/docs/install/catalogs#1-define-catalogs-in-root-package-json- Use Bun
v1.2.14
Still seeing this issue on Bun v1.2.17
bun v1.2.18 works for me