You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to an npm package that has a dependency antlr4ts@^0.5.0-alpha.4. 0.5.0-alpha.4 is marked as latest, but Deno pulls antlr4ts@0.5.0-dev.
This doesn't work for me - as antlr4ts@0.5.0-dev has breaking changes from antlr4ts@0.5.0-alpha.4.
I do agree that 0.5.0-dev comes after 0.5.0-alpha.4 - even, node semver confirms this.
$ deno run npm:semver -hUsage: semver [options] <version> [<version> [...]]Prints valid versions sorted by SemVer precedence
$ deno run npm:semver ^0.5.0-alpha.4 0.5.0-beta0.5.0-beta
But somehow pacote (used inside npm) resolves antlr4ts@^0.5.0-alpha.4 to 0.5.0-alpha.4.
$ deno run -A npm:pacote resolve antlr4ts@^0.5.0-alpha.4http fetch GET 200 https://registry.npmjs.org/antlr4ts 1ms (cache revalidated)https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz
So I did some digging and realized that pacote uses npm-pick-manifest, that has a particular logic, which indicates that if a given tag (defaults to latest) matches with the given version requirement, npm uses the tagged version directly - it doesn't iterate over the versions array.
So in my case, npm-pick-manifest was using the default latest tag and matching with ^0.5.0-alpha.4 and returning early. Whereas Deno npm resolver was going through the version array and picking the latest by semver spec i.e. 0.5.0-dev.
The text was updated successfully, but these errors were encountered:
I am trying to an npm package that has a dependency
antlr4ts@^0.5.0-alpha.4
.0.5.0-alpha.4
is marked aslatest
, but Deno pullsantlr4ts@0.5.0-dev
.This doesn't work for me - as
antlr4ts@0.5.0-dev
has breaking changes fromantlr4ts@0.5.0-alpha.4
.I do agree that
0.5.0-dev
comes after0.5.0-alpha.4
- even, node semver confirms this.But somehow
pacote
(used insidenpm
) resolvesantlr4ts@^0.5.0-alpha.4
to0.5.0-alpha.4
.So I did some digging and realized that
pacote
usesnpm-pick-manifest
, that has a particular logic, which indicates that if a given tag (defaults tolatest
) matches with the given version requirement, npm uses the tagged version directly - it doesn't iterate over theversions
array.So in my case,
npm-pick-manifest
was using the defaultlatest
tag and matching with^0.5.0-alpha.4
and returning early. Whereas Deno npm resolver was going through theversion
array and picking the latest by semver spec i.e.0.5.0-dev
.The text was updated successfully, but these errors were encountered: