错误
安装某 package 时,提示报错:
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/inherits: Cannot read property 'pickAlgorithm' of null
环境
- win 10
- npm v7.16.0 / v7.17.0 也复现
解决
清理缓存后再尝试安装
npm cache clear --force
若以上方法未解决问题,可以尝试查看npm和node对应版本,更新node版本