设置npm淘宝镜像
时间: 2023-07-22 14:13:29 浏览: 66
要设置npm淘宝镜像,可以使用以下命令:
```
npm config set registry https://registry.npm.taobao.org/
```
这会将npm的registry设置为淘宝镜像。如果需要恢复默认的npm registry,可以使用以下命令:
```
npm config set registry https://registry.npmjs.org/
```
相关问题
npm 设置淘宝镜像
可以通过以下命令来设置npm淘宝镜像:
```shell
npm install -g cnpm --registry=https://registry.npm.taobao.org
```
这个命令会安装cnpm,同时将registry设置为淘宝镜像,以后使用npm安装包时就会从淘宝镜像下载,速度会更快。
如果想要永久使用淘宝镜像,可以使用以下命令:
```shell
npm config set registry https://registry.npm.taobao.org
```
这个命令会将registry设置为淘宝镜像,以后使用npm安装包时就会从淘宝镜像下载,不需要每次都加上--registry参数。
如果想要切换回官方镜像,可以使用以下命令:
```shell
npm config set registry https://registry.npmjs.org
```
这个命令会将registry设置为官方镜像,以后使用npm安装包时就会从官方镜像下载。
设置npm的淘宝镜像
要设置npm的淘宝镜像,可以执行以下命令:
```
npm config set registry https://registry.npm.taobao.org/
```
这将把npm的registry配置为淘宝镜像。如果你希望还原为官方镜像,可以执行以下命令:
```
npm config set registry https://registry.npmjs.org/
```