npm更换成淘宝镜像源以及cnpm

    科技2025-07-11  26

    更换镜像为淘宝镜像:

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

    2.检测cnpm版本,如果安装成功可以看到cnpm的基本信息。 cnpm -v

    以后安装插件只需要使用cnpm intall即可

    3.单次使用

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

    注:如果想还原npm仓库地址,只需再把地址配置成npm镜像就可以了

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

    Processed: 0.012, SQL: 8