解决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 @ 2023-09-08 12:47  larybird  阅读(556)  评论(0编辑  收藏  举报