DEV Community

Discussion on: How to migrate from yarn / npm to pnpm

Collapse
 
imp87 profile image
Steven Dautrich

get all time: Invalid package manager specification in package.json; expected a semver version

in my package.json:

"name": "express-demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "echo \"Error: no test specified\" && exit 1"
},
"packageManager": "pnpm@7.1.7>",

Collapse
 
andreychernykh profile image
Andrei Chernykh

It looks like you have a redundant ">" there

"packageManager": "pnpm@7.1.7>",

should be

"packageManager": "pnpm@7.1.7",

Also, this line is optional. It is a node experimental feature. nodejs.org/api/corepack.html

I guess I better remove it from the example