1、问题描述:
在vue项目中,当我们在终端使用指令:npm install 下载 node_modules (节点_模块) 时出现报错的情况
主要是这个原因:npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
翻译:npm错误!无法读取null的属性(读取“pickAlgorithm”)
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
2、解决方案:
**在终端运行命令**:npm cache clear --force(npm缓存清除--强制)
若是上条命令不行,则 npm cache clean --force (npm缓存清理--强制)
一般来说运行完第一条命令,安装就成功了。但经过测试有些人的电脑上要使用缓存清理才行。
大家多多尝试。我自己用的 npm cache clear --force 效果很明显,一下就成功了。
然后再次执行命令进行安装:npm install(npm i)