# A problem in bun workspace

**URL:** <https://forum.codewithmosh.com/t/a-problem-in-bun-workspace/72826>\
**Category:** Uncategorized\
**Created:** [June 5, 2026, 5:00pm UTC](https://forum.codewithmosh.com/t/a-problem-in-bun-workspace/72826 "2026-06-05T17:00:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasan1](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@sasan1](https://forum.codewithmosh.com/u/sasan1)\
**Post date:** [June 5, 2026, 5:00pm UTC](https://forum.codewithmosh.com/t/a-problem-in-bun-workspace/72826/1 "2026-06-05T17:00:15Z")

</div>

i’ve started the project (build ai powered app).  
when i create a workspace with bun to handle both client and server from one node modules  
bun creates seprate node modules for each package this is my main package.json

{

“name”: “ai-powered-app”,

“module”: “index.ts”,

“type”: “module”,

“private”: true,

“devDependencies”: {

“@types/bun”: “latest”

},

“workspaces”: [

“packages/\*”

],

“peerDependencies”: {

“typescript”: “^5”

},

“dependencies”: {

“@types/express”: “^5.0.6”

}

}

i’ll be appreciated from your opinions.

---

<div class="post-metadata">

**Author:** ![gimanuha](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/gimanuha/32/14874_2.png) [@gimanuha](https://forum.codewithmosh.com/u/gimanuha)\
**Post date:** [November 3, 2026, 1:58am UTC](https://forum.codewithmosh.com/t/a-problem-in-bun-workspace/72826/2 "2026-11-03T01:58:33Z")

</div>

Run `bun install` from the workspace root, where the `package.json` containing `"workspaces"` lives. If you installed from inside a package, remove its `node_modules` and any extra lockfile, then install again at the root. Each package should still list the dependencies it imports in its own `package.json`; Bun can hoist compatible versions to the root, but conflicting versions may need separate installs.
