[pjson] `packageManager` key errors out when using pnpm
Closed this issue · 1 comments
DerekNonGeneric commented
Currently, this field specified in package.json:
{
"packageManager": "npm@8.1.0+"
}
Output:
derek@WIN-QCQNRDEGMKF:~/projects/openinf-github-dotrepo$ corepack enable
derek@WIN-QCQNRDEGMKF:~/projects/openinf-github-dotrepo$ pnpm i
Usage Error: Invalid package manager specification in package.json; expected a semver version
$ pnpm ...
Seeing as how this did in fact pass the validation, it should be noted that the regex for validating this field (package.json
schema on schemastore) is wrong when validating this field…
This is not a pnpm field, though; this is a corepack field, which is very confusing…
Refs: https://pnpm.io/package_json
Refs: https://github.com/nodejs/corepack#when-authoring-packages
/cc @arcanis as am currently unsure what is going on here (would like to specify global npm is req'd)
DerekNonGeneric commented
derek@WIN-QCQNRDEGMKF:~/projects/openinf-github-dotrepo$ corepack prepare --all -o --activate
Preparing npm@8.19.2+sha1.db90e88584d065f51b069ab46b4f02f5cf4898b7 for immediate activation...
Preparing pnpm@7.14.1+sha1.12f02fae0a6a63a73e3b854657cd388cc1a84a07 for immediate activation...
Preparing yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447 for immediate activation...
Packing the selected tools in corepack.tgz...
All done!
Alright, the field seems to have just been missing the optional hash ({npm,pnpm,yarn}@{version}+sha1.xxx
).