npm install命令运行出现npm ERR!Cannot read properties of null(reading ‘pickAlgorithm‘)

文章目录

  • 1. 问题描述
  • 2. 问题解释
  • 3. 解决方案:

1. 问题描述

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

npm ERR! Cannot read properties of null (reading 'pickAlgorithm')

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

2. 问题解释

该错误主要是由node高低版本导致的。

3. 解决方案:

在终端运行命令:

# npm缓存清除--强制
npm cache clear --force

然后再次执行命令进行安装:

npm install
# 或者
npm i

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

# npm缓存清理--强制
 npm cache clean --force

你可能感兴趣的:(node,npm,前端,node.js)