位置: IT常识 - 正文

解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)(解决口苦最快的方法)

编辑:rootadmin
解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘) 文章目录1. 复现问题2. 分析问题3. 解决问题

推荐整理分享解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)(解决口苦最快的方法),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:解决的英文,解决肚子胀气最快方法,解决的英文,解决打呼噜只需一杯水,解决掉发的有效方法,解决烧心最快方法,解决烧心最快方法,解决口苦最快的方法,内容如对您有帮助,希望把文章链接给更多的朋友!

1. 复现问题

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

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

PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm install --platform=win32npm 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 dependenciesnpm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependenciesnpm 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_compatibilitynpm WARN deprecated electron-osx-sign@0.5.0: Please use @electron/osx-sign moving forward. Be aware the API is slightly differentnpm 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解决npm ERR! Cannot read properties of null (reading ‘pickAlgorithm‘)(解决口苦最快的方法)

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

方案2

删了node models重新下。

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

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

查看cnpm是否真安装成功:

cnpm -v

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

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

3. 解决问题在终端输入指令npm cache clear --force,如下所示:PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm cache clear --forcenpm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.npm WARN using --force Recommended protections disabled.再次执行指令npm install --platform=win32,即可完成安装,如下所示:PS D:\Software\RedisDesktopManager\AnotherRedisDesktopManager> npm install --platform=win32npm 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 differentnpm 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 dependenciesnpm 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 2m93 packages are looking for funding run `npm fund` for details输入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指令,即可启动程序了,如下所示:

本文链接地址:https://www.jiuchutong.com/zhishi/269199.html 转载请保留说明!

上一篇:WPS广告怎么关闭 ?教你轻松去掉WPS广告方法(wps的广告怎么关掉)

下一篇:苹果14promax电池多少毫安(苹果14promax电池掉电很快)

  • 对“大众品牌”,你可能有三大错觉(对大众品牌的理解)

  • 越狱的朱贤健(越狱的好处)(越狱监狱原型)

  • 抖音口令复制后怎么打开(抖音口令复制后怎么打不开)

  • 为什么芒果视频看不到弹幕(为什么芒果视频打不开)

  • 选择多个连续文件快捷键(选择多个连续文本需要借助快捷键)

  • 美团怎么批量复制商品(美团怎么批量复制同行商品)

  • 联想电脑管家找不到了(联想电脑管家找不到软件搬家)

  • 电脑酷狗音乐打不开怎么回事(电脑酷狗音乐打开不播放音乐)

  • 关联qq号能看到以前的消息吗(关联QQ号能看到对方消息吗)

  • iphone11怎么把电池电量百分比调出来(iphone11怎么把电话卡取出来)

  • 苹果手机用快充充电器对手机有影响吗(苹果手机用快充手机发热)

  • 苹果总是自动关闭软件(苹果总是自动关机是什么原因)

  • soul注销后界面是什么样(soul注销界面是什么样)

  • 手机主题怎么自定义(手机主题怎么自己设置)

  • vivo怎么用无线beats(vivo怎么用无线耳机)

  • win10怎么分盘(win10怎么分盘分配空间)

  • vue照片时长怎么设置(vue设置照片的时长)

  • 小米8微信震动无法关闭(小米微信震动怎么关闭不了)

  • 苹果x广角在哪里(苹果x广角怎么用)

  • 华为p30pro什么时候上市的(华为p30pro什么时候停产的)

  • 华为p20自动锁屏在哪里设置(华为p20自动锁屏怎么解除)

  • 苹果手机紧急联系人怎么设置(苹果手机紧急联络什么意思)

  • 为什么app下载不了(为什么app下载不需要密码)

  • 洗牙的好处与坏处(洗牙的利和弊)

  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设 电脑维修 湖南楚通运网络