npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错问题解决

2023-03-03 11:36:41

目录1、问题描述:2、解决方案:总结1、问题描述:在vue项目中,当我们在终端使用指令:npminstall下载node_modules(节点_模块)时出现报错的情况。node_module...

目录
1、问题描述:
2、解决方案: 
总结 

1、问题描述:

在vue项目中,当我们在终端使用指令:npm install 下载 node_moduphples (节点_模块) 时出现报错的情况。

node_modules是安装node后用来存放用包管理工具下载安装的包的文件夹。比如webpack、gulp、grunt这些工具。

主要是这个原因:npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

翻译:npm错误!无法读取null的属性(读取“pickAlgorithm”) 

npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错问题解决

2、解决方案: 

在终端运行命令:npm cache clear --force(npm缓存清除--强制)

若是上条命令不行,则 npm cache clean --force   (npm缓存清理--强制)

一般来说运行完第一条命令,安装就成功了。但经过测试有些人的电脑上要GdxjLXT使用缓存清理才行。

大家多多尝试。我自己用的 npm cache clear --force 效果很明显,一下就成功了。

然后再次执行命令进行安装:npm install(npm i)

再启动项目即可:npm run dev

npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错问题解决

总结 

到此这篇关于npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错问题解决的文章就介绍到这了,更多相关npm ERR!Cannot read propertiesof null报错内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!