Skip to content

Commit ee19e33

Browse files
Zoltanclaude
andcommitted
fix(pnpm): resolve versionless package specs with the Rust engine
parse-package-name returns an empty string for a spec with no version (e.g. 'is-positive', '@teambit/react.react-env'). The napi resolver rejects an empty bareSpecifier with "isn't supported by any available resolver" — only undefined (or an explicit range) resolves as latest. This broke every 'bit install <pkg>' / 'bit create' path that resolves a package without a version (~60 e2e failures on CI). Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 35185fd commit ee19e33

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎scopes/dependencies/pnpm/lynx.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,9 @@ export async function resolveRemoteVersion(
667667
const parsedPackage = parsePackageName(packageName);
668668
const wantedDep: nodeApi.WantedDependency = {
669669
alias: parsedPackage.name,
670-
bareSpecifier: parsedPackage.version,
670+
// parse-package-name returns an empty string when no version is present,
671+
// but the engine resolves only undefined (or an explicit range) as "latest".
672+
bareSpecifier: parsedPackage.version || undefined,
671673
};
672674
const val = await resolve(wantedDep, resolveOpts);
673675
if (!val.manifest) {

0 commit comments

Comments
 (0)