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

转载自:https://www.cnblogs.com/zhyp/p/16920380.html

=========

解决方法:
在终端中运行命令:
npm cache clear --force

然后重新运行 npm i 命令,再次安装
安装完成,没有出现报错
npm run serve 运行项目,项目可以正常启动了。

 

 

安装vue CLI失败后,百度得知在终端执行命令:npm clean cache -force 后大部分人都解决了,但我试过后还是无效。

一种解决方案是尝试重新安装node。

执行指令npm clean cache -force 失效的一个可能的原因是,终端的一些指令是不能随便执行的,需要管理员权限。

执行指令清空,清空的就是一个内部的文件夹,在user/administrator/AppData/Roaming/npm cache里,把npm cache这个文件夹删
掉,然后再去执行npm clean cache -force 这个命令,就可以了。

 

 安装mac版本npn:

https://nodejs.org/download/release/v14.21.3/

 

安装vue:

sudo npm install -g @vue/cli

sudo npm install @vue/cli-service -g

参考文档:https://blog.csdn.net/qq_25479327/article/details/106562125

 
posted @   larybird  阅读(906)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示