Node.js npm 配置

一、概要

1. 环境

(1) Rocky Linux 9.2

二、配置

1. 镜像

(1) 查看镜像

npm config get registry

(2) 配置镜像

npm config set registry 镜像地址

(3) 镜像列表

淘宝: https://registry.npm.taobao.org
阿里云: https://npm.aliyun.com/
CNPM: http://registry.cnpmjs.org

2. 证书校验失败

certificate has expired

(1) 取消SSL验证

npm config get strict-ssl
npm config set strict-ssl false

3. cnpm 

(1) 安装

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

 

posted @ 2024-07-07 22:49  白马黑衣  阅读(3)  评论(0编辑  收藏  举报