当前位置:网站首页>NPM - Cannot read properties of null (reading 'pickAlgorithm') 解决方案

NPM - Cannot read properties of null (reading 'pickAlgorithm') 解决方案

2022-08-10 15:02:00 为为为什么

当本地 npm 包版本与项目配置不一致时经常出现各种引用错误,本文记录解决方案。

问题复现

  • 在已经配置好的 npm 环境种,修改 package.json 后经常产生错误:
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-07-04T01_55_30_086Z-debug-0.log

解决方案

  • 清除缓存npm cache clear --force之后再重新安装依赖npm install
npm cache clear --force
npm install

  • 若出现端口号冲突 1、关闭该端口的进程; 2、通过 npm serve --port 4201 指定端口号打开

参考资料

原网站

版权声明
本文为[为为为什么]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/2069634