npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
问题描述
拿到一个项目,使用 npm install 安装依赖包,结果却出现了下面的报错:
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac/.npm/_logs/2022-07-13T14_36_26_298Z-debug-0.log
解决方法
解决方法如下:
首先先清理一下缓存:npm cache clean --force
接着就是,再次使用npm install
进行安装,
如果不行,就使用 yarn!
如果没有安装 yarn 的,可以先查看 yarn 版本,没安装就先安装。
最后使用 yarn 代替 npm 运行这个项目就好了。
如图,最后 成功运行!
【补充,npm 和 yarn 不能一起使用,但是在最开始 start、restart 项目时没有关系。】
原文地址 blog.csdn.net
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 清华大学推出第四讲使用 DeepSeek + DeepResearch 让科研像聊天一样简单!
· 推荐几款开源且免费的 .NET MAUI 组件库
· 实操Deepseek接入个人知识库
· 易语言 —— 开山篇
· Trae初体验