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 install not working for workspace projects from root #3806

Closed
AWare opened this issue Jul 25, 2023 · 1 comment
Closed

bun install not working for workspace projects from root #3806

AWare opened this issue Jul 25, 2023 · 1 comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@AWare
Copy link

AWare commented Jul 25, 2023

What version of Bun is running?

0.7.1

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

  1. create a pair of empty packages, a & b where b is in a subfolder of b
  2. add the subfolder to workspaces in a
  3. add some dependency to b
  4. install
mkdir -p a/packages/b
cd a 
bun init -y
cd packages/b
bun init -y

add "workspaces": ["packages/*"], to a/package.json
and some dependency to packages/b/package.json

cd packages/b
cd ../..
bun install

What is the expected behavior?

I expect the dependency to be present in a/packages/b/node_modules

What do you see instead?

b's dependencies have not been installed

Additional information

I would expect running bun install in b also to install the full project.

I might also expect some kind of ability to restrict or filter this like pnpm provides.

@AWare AWare added the bug Something isn't working label Jul 25, 2023
@robobun robobun added the bun install Something that relates to the npm-compatible client label Jul 25, 2023
@Jarred-Sumner
Copy link
Collaborator

Jarred-Sumner commented Nov 15, 2023

This was fixed some time ago, most likely in Bun v1.0.3 or so

Build/worky2/a
❯ cd packages/b
  cd ../..
  bun install^C

Build/worky2/a
❯ code packages/b/package.json

Build/worky2/a
❯ cd packages/b
  cd ../..
  bun install
bun install v1.0.11 (8f3e278a)
 + b@workspace:packages/b

 1 package installed [99.00ms]
  Removed: 2

Build/worky2/a
❯ ls node_modules
b@  bun-types/  typescript/

Build/worky2/a
❯ cat package.json
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: package.json
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ {
   2   │   "name": "a",
   3   │   "module": "index.ts",
   4   │   "type": "module",
   5   │   "workspaces": [
   6   │     "packages/*"
   7   │   ]
   8   │ }
───────┴───────────

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

3 participants