Package managers use what is known as a solver/package resolver to identify exact versions of dependencies that are compatible with each other. Each solver has different properties and may have different solutions. This is what makes things difficult: either we manually port npm's package solver to Rust, which takes a lot of time, or use a different solver such as Pubgrub (more on that later)
This is the registry client and dependency resolver used by Deno.
- Deno has been battle-tested, and deno_npm has plenty of tests.
- Written in Rust, no need to call out to Node to solve packages.
- Deeply integrated with a lot of the deno_* crates, which removes the point (this is a project for learning after all!)
- Weird Deno-related quirks, such as a hardcoded version of @types/node
Used by Dart, and by extension Flutter.
- It's fast. Like, really fast.
- Battle-tested with Flutter and Dart, which are arguably more popular than Deno.
- Great error messages built-in
- The differences between the Pubgrub and the npm solver could use incompatibilities and subtle issues (such as one working fine, and the other using a broken version of a package)