ERR_PNPM_INVALID_OVERRIDE_SELECTOR Cannot parse the “//“ selector in the o

博客内容描述了在运行pnpminstall时遇到的错误`ERR_PNPM_INVALID_OVERRIDE_SELECTOR`,原因是解析`//`选择器失败。通过检查pnpmdebug日志,发现错误源在`package.json`的`resolutions`字段。解决方案是删除`resolutions`中的`//`。遵循这个解决方案,问题可以得到解决。
摘要由CSDN通过智能技术生成

运行 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 删除 “//”

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
>