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

这篇文章主要讲解了“npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错如何解决”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“npm ERR!Cannot read properties of null(reading 'pickAlgorithm')报错如何解决”吧!

1、问题描述:

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

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缓存清理--强制)

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

大家多多尝试。我自己用的 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 properties of null(reading 'pickAlgorithm')报错如何解决这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程之家,小编将为大家推送更多相关知识点的文章,欢迎关注!

相关文章

什么是Go的接口? 接口可以说是一种类型,可以粗略的理解为他...
1、Golang指针 在介绍Golang指针隐式间接引用前,先简单说下...
1、概述 1.1 Protocol buffers定义 Protocol buffe...
判断文件是否存在,需要用到"os"包中的两个函数: os.Stat(...
1、编译环境 OS :Loongnix-Server Linux release 8.3 CPU指...
1、概述 Golang是一种强类型语言,虽然在代码中经常看到i:=1...