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
If so, I believe the cause is that in your package.json, the version field is v0.34.0. I've always seen the version field without the v, because that's what the npm version command writes.
I didn't truthfully know that npm would accept that! But, since node-semver can parse it, npm seems happy. The bug in npm-publish is that it only checks strings in the default strategy. It calls npm info @ovh-devrelteam/pulumi-ovh and receives 0.34.0 from npm. Since 0.34.0 !== v0.34.0 (from npm and the package.json, respectively), it tries to publish.
The reason strategy: upgrade works is because in the upgrade strategy, we pass both versions into node-semver to compare them
changed the title [-]Try to publish npm package even if already exists in the registry[/-][+]`v`-prefix in `package.json` version causes false negative during version comparison[/+]on Sep 12, 2023
Activity
scraly commentedon Sep 12, 2023
After several tried, the strategy upgrade resolved it... crossed fingers for the next time :)
mcous commentedon Sep 12, 2023
Hi @scraly, that doesn't sound good. Is this the repository? https://github.com/ovh/pulumi-ovh
If so, I believe the cause is that in your
package.json
, theversion
field isv0.34.0
. I've always seen theversion
field without thev
, because that's what thenpm version
command writes.I didn't truthfully know that
npm
would accept that! But, sincenode-semver
can parse it,npm
seems happy. The bug innpm-publish
is that it only checks strings in the default strategy. It callsnpm info @ovh-devrelteam/pulumi-ovh
and receives0.34.0
fromnpm
. Since0.34.0 !== v0.34.0
(from npm and the package.json, respectively), it tries to publish.The reason
strategy: upgrade
works is because in the upgrade strategy, we pass both versions intonode-semver
to compare them[-]Try to publish npm package even if already exists in the registry[/-][+]`v`-prefix in `package.json` version causes false negative during version comparison[/+]fix: use validated package.json version in manifest
fix: use validated package.json version in manifest (#147)