安装cnpm时警告:npm WARN deprecated request@2.88.2解决办法

这篇博客详细介绍了如何解决npm安装时遇到的问题,包括降低npm版本、设置淘宝镜像、验证配置、清除缓存以及安装和验证cnpm的过程。通过这些步骤,开发者可以更顺利地在中国境内进行npm包的安装。

首先看问题所在

在这里插入图片描述

解决办法如下

1、首先降低npm版本

npm install npm@4.6.1 -g

2、接着使用淘宝镜像

npm config set registry https://registry.npm.taobao.org

3、然后验证一下是否成功

npm config get registry

4、再清除一下安装缓存

npm cache clean --force

5、最后安装 cnpm

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

6、使用 cnpm -v 查看是否安装成功

Microsoft Windows [版本 10.0.18363.1316]
(c) 2019 Microsoft Corporation。保留所有权利。

C:\Users\ASUS\Desktop\新建文件夹 (2)>cnpm -v
cnpm@6.1.1 (D:\nodejs\node_gobal\node_modules\cnpm\lib\parse_argv.js)
npm@6.14.11 (D:\nodejs\node_gobal\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@14.6.0 (D:\nodejs\node.exe)
npminstall@3.28.0 (D:\nodejs\node_gobal\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=D:\nodejs\node_gobal
win32 x64 10.0.18363
registry=https://r.npm.taobao.org
vue安装C:\Windows\System32>npm install vue-cli -g (node:1392) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. (Use `node --trace-warnings ...` to show where the warning was created) npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli 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 rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm WARN deprecated consolidate@0.14.5: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) added 259 packages in 39s
07-03
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

水星记_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值