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

No version matching "npm:strip-ansi@^6.0.1" found for specifier "strip-ansi-cjs" (but package exists) #4669

Closed
ChiefORZ opened this issue Sep 9, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ChiefORZ
Copy link

ChiefORZ commented Sep 9, 2023

What version of Bun is running?

0.1.2

What platform is your computer?

Darwin 21.6.0 x86_64 i386

What steps can reproduce the bug?

mkdir bun-test && cd ./bun-test
bun init
bun add @isaacs/cliui

What is the expected behavior?

It should resolve dependencies with the npm: prefix correctly

What do you see instead?

error: No version matching "npm:string-width@^4.2.0" found for specifier "string-width-cjs" (but package exists)
error: No version matching "npm:strip-ansi@^6.0.1" found for specifier "strip-ansi-cjs" (but package exists)
error: No version matching "npm:wrap-ansi@^7.0.0" found for specifier "wrap-ansi-cjs" (but package exists)

Additional information

When i look at the corresponding package.json from the dependency @isaacs/cliui i see this resolution:

  "dependencies": {
    "string-width": "^5.1.2",
    "string-width-cjs": "npm:string-width@^4.2.0",
    "strip-ansi": "^7.0.1",
    "strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
    "wrap-ansi": "^8.1.0",
    "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
  }

so its requesting the packages in cjs version in their previous version - to prevent breaking changes i guess.
bun can ignore them in the end, but it should download the dependencies anyways so the dependency graph is satisfied.

this problem is quite problematic, because @isaacs/cliui is used by [email protected] wich is used by a lot of packages

@ChiefORZ ChiefORZ added the bug Something isn't working label Sep 9, 2023
@ChiefORZ
Copy link
Author

ChiefORZ commented Sep 9, 2023

another question - is there a way to override resolved dependencies in bun?
the equivalent to yarn's "resolutions" or pnpm "overrides"

@julianklumpers
Copy link

julianklumpers commented Sep 9, 2023

I have the same problem with @MUI/lab
getting this error: error: package "@mui/x-tree-view" with tag "https://pkg.csb.dev/mui/mui-x/commit/1f23b33d/@mui/x-tree-view" not found, but package exists

issue: 4666

@ChiefORZ
Copy link
Author

ChiefORZ commented Sep 9, 2023

had to update bun to 1.0 with bun upgrade, works like a charm now - kudos 👏

@ChiefORZ ChiefORZ closed this as completed Sep 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants