npm 安装报错:Cannot read property ‘pickAlgorithm‘ of null

问题:

npm 安装报错:Cannot read property ‘pickAlgorithm‘ of null

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\XXX\AppData\Local\npm-cache\_logs\2022-06-22T09_17_21_151Z-debug-0.log

解决:

1.首先windows+R,输入cmd 进入命令窗口 ,输入npm install,查看报错信息,很明显版本不匹配;

npm WARN npm npm does not support Node.js v14.14.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can’t make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\pc\AppData\Roaming\npm-cache_logs\2020-10-23T08_30_48_208
Z-debug.log

 

2.命令窗口执行npm install npm -g,然后输入node -v 和npm -v,查看node和npm的版本;

3.以往的版本 | Node.js,进入查看node和npm匹配版本分别是多少;

4.然后根据自己的node版本来更新npm 版本
npm -g install npm@8.3.1

5.如果还是显示npm 不支持这个版本,需要到C:\Users\pc\AppData\Roaming 根目录下
删除npm, npm-cache两 个文件

然后执行: npm -g install npm@8.3.1

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值