您现在的位置是:主页 > news > 做的网站怎么进入互联网/alexa排名

做的网站怎么进入互联网/alexa排名

admin2025/4/22 14:25:09news

简介做的网站怎么进入互联网,alexa排名,wordpress 近期文章代码,wordpress 影响力文章目录问题描述解决办法更换安装源安装nrm查看可以使用的安装源测试源(看哪个源的速度最快)添加一个新的源更换源删除源使用cnpm 或者 yarn,切换淘宝镜像安装cnpm安装yarn使用国内镜像加速npm和yarnunable to verify the first certificate…

做的网站怎么进入互联网,alexa排名,wordpress 近期文章代码,wordpress 影响力文章目录问题描述解决办法更换安装源安装nrm查看可以使用的安装源测试源(看哪个源的速度最快)添加一个新的源更换源删除源使用cnpm 或者 yarn,切换淘宝镜像安装cnpm安装yarn使用国内镜像加速npm和yarnunable to verify the first certificate…

文章目录

    • 问题描述
    • 解决办法
    • 更换安装源
      • 安装nrm
      • 查看可以使用的安装源
      • 测试源(看哪个源的速度最快)
      • 添加一个新的源
      • 更换源
      • 删除源
    • 使用cnpm 或者 yarn,切换淘宝镜像
    • 安装cnpm
    • 安装yarn
    • 使用国内镜像加速npm和yarn
    • unable to verify the first certificate报错?

问题描述

使用 npm install 命令,下载相关依赖库,但是由于网络原因,下载速度快

解决办法

切换镜像,从npm 默认镜像https://registry.npmjs.org/改为国内的

更换安装源

nrm(npm registry manager )是npm的镜像源管理工具,有时候国外资源太慢,使用这个就可以快速地在 npm 源间切换

安装nrm

npm install nrm --global

查看可以使用的安装源

	nrm ls

结果

* npm -------- https://registry.npmjs.org/yarn ------- https://registry.yarnpkg.com/cnpm ------- http://r.cnpmjs.org/taobao ----- https://registry.npmmirror.com/nj --------- https://registry.nodejitsu.com/npmMirror -- https://skimdb.npmjs.com/registry/edunpm ----- http://registry.enpmjs.org/

测试源(看哪个源的速度最快)

	nrm test

结果

* npm ---- 1195msyarn --- 2936mscnpm --- 235mstaobao - 224msnj ----- Fetch ErrornpmMirror  6066msedunpm - Fetch Error

备注: 数字越小,响应速度越快

添加一个新的源

nrm add newRep http://IP:端口/repository/npm-public/

newRep 是添加源的名字,类似于 “taobao”一样

更换源

nrm use taobao
  1. 使用 npm config list 命令,可以查看到 registry = "https://registry.npmjs.org/"
  2. 执行 nrm use taobao
  3. 使用 npm config list 命令,可以查看到 registry = "https://registry.npmmirror.com/"

删除源

nrm del aaa

使用cnpm 或者 yarn,切换淘宝镜像

安装cnpm

npm install -g cnpm --registry=https://registry.npmmirror.com

安装yarn

cnpm install -g yarn

使用国内镜像加速npm和yarn

  1. npm config set registry=https://registry.npmmirror.com 等价于 nrm use taobao

  2. yarn config set registry https://registry.npmmirror.com

unable to verify the first certificate报错?

切换到淘宝镜像之后报如上错误,解决办法如下:

npm config set strict-ssl false

或者

yarn config set strict-ssl false