cnpm,yarn的安装

本文详细介绍了在Windows环境下安装cnpm和yarn的过程,包括检查node.js安装,设置淘宝镜像作为npmregistry,解决可能的网络问题,以及安装和配置yarn的淘宝源。此外,还提供了如何移除代理和安装cnpm镜像的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

cnpm的安装
1.安装node 打开cmd
2.node -v 查看node是否已安装
3.安装淘宝镜像

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

4.查看cnpm是否真安装成功 cnpm -v
5.安装yarn
npm install -g yarn
6.查看版本:yarn --version
7.Yarn 淘宝源安装,分别复制粘贴以下代码行到黑窗口运行即可

yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

报错:
1、info There appears to be trouble with your network connection. Retrying…
安装好后更换淘宝镜像

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

移除原代理(慎用)

yarn config delete proxy
npm config rm proxy
npm config rm https-proxy

安装cnpm镜像并使用代理registry
安装cnpm镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org
或者
npm install -g cnpm --registry=https://registry.npmmirror.com

使用代理registry

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值