Bun is creating another node_modules folder in one of the packages

I am following the new course Build AI Powered Apps, and I am currently at Creating the Frontend. According to Mosh, Bun is supposed to install packages in the node modules folder of the app folder and not in the package folder, but Bun is doing exactly that.

Am I doing something wrong?

1 Like

Nothing is wrong. This is a specific to bun behavior now. When you add workspaces to your package.json file you set up the correct structure. After running bun init from packages/server folder you see node_modules folder on the root and server folder levels, but the server’s node_modules folder is technically not a real location of your installed dependencies. The dependencies are still located on the root level. After you install any dependency and check out the packages/server/node_modules folder you’ll see that it contains only symbolic links that refer to the root node_modules folder. I know it is confusing, but it is all correct.

1 Like

Thanks for submitting and answering this question

Thanks for clarifying this.