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

发布时间:2023-03-08 11:15:59 作者:iii
来源:亿速云 阅读:217

这篇文章主要讲解了“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')报错如何解决这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

推荐阅读:
  1. 如何解决mysql登录错误'Access denied for user 'root'@'localhost'问题
  2. python报错: 'list' object has no attribute 'shape'怎么办

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

npm

上一篇:vue keep-alive多层级路由支持问题怎么解决

下一篇:JavaGUI常用三种布局方法如何使用

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》