运行 pnpm install 报错
ERR_PNPM_INVALID_OVERRIDE_SELECTOR
pnpm: Cannot parse the \"//\" selector in the overrides\n at parsePkgSelector
pnpm debug 可以看出:
"err": {
"name": "pnpm",
"message": "Cannot parse the \"//\" selector in the overrides",
"code": "ERR_PNPM_INVALID_OVERRIDE_SELECTOR",
"stack": "pnpm: Cannot parse the \"//\" selector in the overrides\n at parsePkgSelector (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:118765:15)\n at /Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:118757:22\n at Array.map (<anonymous>)\n at parseOverrides (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:118743:40)\n at default_1 (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:118789:152)\n at createReadPackageHook (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:119818:58)\n at mutateModules (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:119567:32)\n at async install (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:119544:24)\n at async handler (/Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:121182:31)\n at async /Users/yseventeen/.nvm/versions/node/v16.14.2/lib/node_modules/pnpm/dist/pnpm.cjs:175770:21"
}
解决方案:
package.json
resolutions 删除 “//”