解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)

news2025/2/27 8:24:40

文章目录

  • 1. 复现问题
  • 2. 分析问题
  • 3. 解决问题

在这里插入图片描述

1. 复现问题

今天准备克隆Redis桌面(GUI)管理客户端,故按照官方文档给出的指令运行时,如下图所示:

在这里插入图片描述

但在执行指令npm install --platform=win32却报出如下图错误:

PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm install --platform=win32
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated electron-osx-sign@0.5.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\zxy\AppData\Local\npm-cache\_logs\2022-11-04T07_24_57_963Z-debug-0.log

注意看上述错误的倒数第3行,即Cannot read properties of null (reading 'pickAlgorithm')

2. 分析问题

Cannot read properties of null (reading 'pickAlgorithm')翻译成中文就是无法读取 null 的属性(读取 'pickAlgorithm')

但是,我在运行指令npm install --platform=win32时,并没有涉及pickAlgorithm字段呀,于是,通过查找资料可得如下解决方案:

  1. 方案1

重新安装node解决,这并没有解决我的问题,舍弃。

  1. 方案2

删了node models重新下。

或者直接下载CNPM(淘宝镜像)进行安装CNPM安装办法:

npm install -g cnpm -registry=https://registry.npm.taobao.org

查看cnpm是否真安装成功:

cnpm -v

这种方式也没有解决我的问题。

于是,使用如下第3种方案解决了我的问题。

3. 解决问题

  1. 在终端输入指令npm cache clear --force,如下所示:
PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm cache clear --force
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN using --force Recommended protections disabled.
  1. 再次执行指令npm install --platform=win32,即可完成安装,如下所示:
PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm install --platform=win32
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated electron-osx-sign@0.5.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly different
npm WARN deprecated svgo@0.7.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

added 706 packages, and changed 55 packages in 2m

93 packages are looking for funding
  run `npm fund` for details
  1. 输入npm start启动程序,如下图所示:

在这里插入图片描述

此时,报出另外一个错误,即 Cannot find module 'D:\Software\RedisDesktopManager\AnotherRedisDesktopManager\node_modules\fs.realpath\index.js'. Please verify that the package.json has a valid "main" entry

即在当前目录下找不到index.js文件,于是,我们去当前目录下区创建该文件即可:

在这里插入图片描述

创建index.js文件后,再次执行npm start指令,即可启动程序了,如下所示:

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/405251.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Vue中使用Datav 完成大屏基本布局

效果图 大屏前言 在实际开发过程中&#xff0c;我们经常需要一个大屏进行一些常规数据的展示。在Vue中也是提供了这样的容器组件 我们可以使用基于Vue的 Datav组件 Vue-Baidu-Map地图组件 Echarts图表组件 时间戳就实现基本布局 在Vue中配置大屏路由的时候&#xff0c;我们…

vue播放rtsp视频流

工作有要播放视频监控的需求&#xff0c;最近就自己先了解了一下网页播放rtsp视频流的方法&#xff0c;以下是我的个人经验。 最终选择了vuewebrtc-streamer实现在网页播放rtsp流这种方法进行测试。 个人经验 第一次尝试了vue-video-playervideojs的方法&#xff0c;发现只适…

WPS JS宏入门案例集锦

JS宏官方API文档&#xff1a;https://qn.cache.wpscdn.cn/encs/doc/office_v19/index.htm 批量创建工作表/簿 批量创建工作表&#xff1a; function 批量创建工作表(){for (var city of ["成都","上海","北京"]){let sht Worksheets.Add();s…

无需本地部署 在线使用Stable Diffusion Webui 使用共享模型

尝试本地部署Stable Diffusion的时候遇到了很多的麻烦&#xff0c;自己训练AI也非常的麻烦&#xff0c;可以尝试使用Webui使用别人上传的模型第一步进入网站https://github.com/camenduru/stable-diffusion-webui-colab向下拉到readme第一个 stable_diffusion_webui_colab&…

前端常见八大设计模式

一、设计模式是什么&#xff1f; 设计模式是在某种场合下对某个问题的一种解决方案。设计模式是通过概念总结出来的模版&#xff0c;总结出来的固定的东西。每一个模式描述了一个在我们周围不断重复发生的问题&#xff0c;以及该问题的解决方案的核心。 二、设计原则–设计模…

给女友的网页小惊喜,(生日,周年,表白通用) ☞谁说程序员不懂浪漫

有女朋友的拿去给女朋友一个惊喜&#xff0c;没女朋友的拿去表白&#xff0c;或者NEW它10000000个&#xfeff;ε≡٩(๑>₃<)۶ 文章目录前言适用范围网页展示登录界面文字界面图片界面尾部界面获取源码前言 前些日子是女友的一周年&#xff0c;康康想用一种特殊的方式…

vue实现导出word文档(含多张图片)

一、实现效果 以填写并导出房屋出租审批表为例&#xff0c;首先填写表格相应内容后&#xff0c;点击" 导出 "按钮实现word文档的导出功能&#xff0c;界面如下所示&#xff1a; 最后导出word文档如下所示&#xff1a; 二、所需插件 这里使用npm对以下所需依赖进…

【SpringBoot+Vue】全网最简单但实用的前后端分离项目实战笔记 - 前端

配套视频地址&#xff1a;https://www.bilibili.com/video/BV1dG4y1T7yp/ 前端笔记 1. node环境 官网&#xff1a;https://nodejs.org 注意&#xff0c;node可以比我稍低&#xff0c;但不要更高 2. 下载vue-admin-template https://panjiachen.gitee.io/vue-element-admin…

HTML表格合并行和列

HTML表格合并行和列1.合并行&#xff1a;rowspan2.合并列&#xff1a;colspan1.合并行&#xff1a;rowspan 在设计表格时&#xff0c;有时我们需要将“横向的N个单元格”或者“纵向的N个单元格”合并成一个单元格&#xff08;类似Word的表格合并&#xff09;&#xff0c;这个时…

2023前端最新高频面试题总结(附答案)

目录 1.vue双向数据绑定的原理&#xff1f; 2.vue的生命周期有哪些 3.v-if 和v-show有什么区别&#xff1f; 4.async await 是什么&#xff1f;它有哪些作用&#xff1f; 5、数组常用的方法&#xff1f;哪些方法会改变原数组&#xff0c;哪些不会 6.什么是原型链&#xf…

前端网页设计必逛的六个宝藏网站(非常值得收藏)

&#x1f389;个人主页&#xff1a;这个昵称我想了20分钟 ✨往期专栏&#xff1a; 【速成之路】jQuery 【SQL server速成之路】 素材网站✨iconfont阿里巴巴矢量图标库  ✨美叶  ✨IconPark  ✨pexels  ✨COLOR  ✨Uigradients✨iconfont阿里巴巴矢量图标库 网站入口…

【微信小程序】使用uni-app——开发首页搜索框导航栏(可同时兼容APP、H5、小程序)

目录 前言 App、H5效果 小程序效果 一、兼容APP、H5的方式 二、兼容小程序 三、实现同时兼容 前言 首页都会提供一个搜索框给到客户&#xff0c;让客户自己去搜索自己想要的内容&#xff0c;这里就需要导航栏&#xff0c;来实现搜索页面的跳转&#xff0c;效果如下 App…

Vue框架教程-从入门到项目实战

创建Vue项目 我们通过vue-cli创建一个vue项目&#xff0c; 在cmd窗口输入 vue ui 进入vue-cli可视化界面&#xff08;如果无效请升级vue-cli版本&#xff09;点击创建&#xff0c;选择一个项目目录输入项目名称和git初始化窗口(可选)选择预设&#xff0c;可以选择手动和预定的…

如何清除全部的定时器

通过 setTimeout() 函数来建立定时器&#xff0c;并通过 clearTimeout() 函数来清除定时器。 let timerTimeout setTimeout(() > {console.log("2222222-----------------------------"); }, 1000); clearTimeout(timerTimeout);通过 setInterval() 函数来建立定…

Node.js error: ERR_OSSL_EVP_UNSUPPORTED

Node.js 17版本的更新日志&#xff1a; 2021-10-19, Version 17.0.0 (Current), BethGriggs Notable Changes ... OpenSSL 3.0 Node.js now includes OpenSSL 3.0, specifically quictls/openssl which provides QUIC support. With OpenSSL 3.0 FIPS support is again availab…

npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。

报错起因 在VScode中运行vue项目时&#xff0c;【前提&#xff1a;把项目文件换到另一个网盘存放&#xff0c;存放失败&#xff0c;又重新放回原位置再次运行时】 报错如下&#xff1a; npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查 解决…

C++——WebServer服务器项目

项目场景&#xff1a; C——WebServer服务器编程 项目搭建 &#xff08;1&#xff09;配置虚拟机&#xff0c;下载XShell、Xftp以及windows版本的VScode&#xff1b; &#xff08;2&#xff09;安装SSH&#xff1a; sudo apt install openssh-server&#xff08;3&#xff…

React组件的生命周期函数

文章目录React组件生命周期认识生命周期生命周期函数不常用生命周期函数React组件生命周期 认识生命周期 很多的事物都有从创建到销毁的整个过程&#xff0c;这个过程称之为是生命周期&#xff1b; React组件也有自己的生命周期&#xff0c;了解组件的生命周期可以让我们在最…

controller层,service层,mapper层,entity层的作用与联系。

一. controller层 controller层是用来接受前台数据和返回页面请求信息的&#xff0c;Controller层是不允许直接操作数据库的&#xff01;它就像一个服务员&#xff0c;哪桌客人需要点菜了&#xff0c;就喊一声服务员&#xff01; 对应的&#xff0c;外界需要完成什么样的业务&…

Css 弹性布局(Flex)详细介绍(Flex 属性详解、场景分析)

目录​​​​​​​ 前言 Flex 布局是什么&#xff1f; Flex 简介 Flex 容器属性 Flex 基本使用 场景一 flex-direction 场景二 justify-content align-items flex-wrap 场景三 前言 我们知道&#xff0c;网页展示就好比一个个盒子堆叠在一起&#xff0c;通过调整…