5 更换npm为国内镜像
更改npm为国内镜像
在终端执行.
npm set registry http://registry.npmmirror.com
首先, 打开"我的电脑". 找到"c盘中用户文件夹". 找到你当前正在使用的"用户"





代码如下.
registry=http://registry.npmmirror.com/
disturl=https://registry.npmmirror.com/-/binary/node/
# node-sass预编译二进制文件下载地址
sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass
# sharp预编译共享库, 截止2022-09-20 sharp@0.31.0的预编译共享库并未同步到镜像, 入安装失败可切换到sharp@0.30.7使用
sharp_libvips_binary_host=https://registry.npmmirror.com/-/binary/sharp-libvips
python_mirror=https://registry.npmmirror.com/-/binary/python/
electron_mirror=https://registry.npmmirror.com/-/binary/electron/
electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/
# 无特殊配置参考{pkg-name}_binary_host_mirror={mirror}
canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas
node_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/sqlite3
better_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/better-sqlite3
MAC同学,
如果是M1芯片的. 需要先更新一些库. 不是M1的不用管
包括但不限于:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
命令行方式:
npm config set registry http://registry.npmmirror.com
编辑 ~/.npmrc 文件, 设置方案和windows的一样
registry=http://registry.npmmirror.com/
disturl=https://registry.npmmirror.com/-/binary/node/
# node-sass预编译二进制文件下载地址
sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass
# sharp预编译共享库, 截止2022-09-20 sharp@0.31.0的预编译共享库并未同步到镜像, 入安装失败可切换到sharp@0.30.7使用
sharp_libvips_binary_host=https://registry.npmmirror.com/-/binary/sharp-libvips
python_mirror=https://registry.npmmirror.com/-/binary/python/
electron_mirror=https://registry.npmmirror.com/-/binary/electron/
electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/
# 无特殊配置参考{pkg-name}_binary_host_mirror={mirror}
canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas
node_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/sqlite3
better_sqlite3_binary_host_mirror=https://registry.npmmirror.com/-/binary/better-sqlite3
附赠:
npm官方库搜索: https://www.npmjs.com/
JS语法规则:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference
rsa.js很古老的一个库 https://ohdave.com/rsa/
5 更换npm为国内镜像的更多相关文章
- 更换 npm 源国内镜像 cnpm
默认镜像源 https://www.npmjs.com/ 临时改变镜像源 方法一:通过config配置指向国内镜像源 npm config set registry http://registry.c ...
- npm配置国内镜像资源+淘宝镜像
将npm的注册表源设置为国内的镜像 1.国内用户,建议将npm的注册表源设置为国内的镜像,可以大幅提升安装速度 2.国内优秀npm镜像推荐及使用:http://riny.net/2014/cnpm/ ...
- npm 使用国内镜像的方法
npm全称Node Package Manager,是node.js的模块依赖管理工具.由于npm的源在国外,所以国内用户使用起来各种不方便.我们通过设置使用淘宝的镜像来加快我们的速度. 临时使用 n ...
- npm使用国内镜像的方法
一.通过命令配置1. 命令 npm config set registry https://registry.npm.taobao.org 2. 验证命令 npm config get registr ...
- 修改apt,pip,npm为国内镜像源
apt 原文件备份 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 编辑源列表文件 sudo vim /etc/apt/sources. ...
- 使用nvm管理node.js版本以及更换npm淘宝镜像源
目录 1,前言 2,安装nvm 3,nvm的使用 4,错误处理 5,修改npm默认镜像源 6,win10下cnpm报错 1,前言 注意:此教程仅限Windows,Mac可能不适用 在我们的日常开发中可 ...
- Node.js NPM国内镜像
NPM国内镜像 http://npm.hacknodejs.com/ http://registry.npmjs.vitecho.com/ https://registry.npm.taobao.or ...
- npm 国内镜像资源 --转载
npm 是node.js 环境下的包管理器,非常强大智能. 生活这这片神奇的土地上,各种奇葩手段屡见不鲜啊. 为什么要换源? npm 官方站点 http://www.npmjs.org/ 并没有被墙, ...
- 给电脑换源 npm 国内镜像 cnpm
(1)通过 config 配置指向国内镜像源 npm config set registry http://registry.cnpmjs.org //配置指向源 npm info express ...
- pip 更换国内镜像与记录
更换pip源到国内镜像 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/sim ...
随机推荐
- win32 - 检查权限
检查当前句柄是否有指定的权限. #include <iostream> #include <windows.h> #include <tchar.h> //#pra ...
- pikachu sql inject header 注入
使用admin登录 显示以下内容 朋友,你好,你的信息已经被记录了:点击退出 你的ip地址:172.17.0.1 你的user agent:Mozilla/5.0 (X11; Ubuntu; Linu ...
- OFDM系统各种调制阶数的QAM误码率(Symbol Error Rate)与 误比特率(Bit Error Rate)仿真结果
本文是OFDM系统的不同QAM调制阶数的误码率与误比特率仿真,仅考虑在高斯白噪声信道下的情景,着重分析不同信噪比下的误码(符号)率性能曲线,不关心具体的调制与解调方案,仿真结果与理论的误码率曲线进行了 ...
- 使用Java线程同步工具类CountDownLatch
java.util.concurrent.CountDownLatch是Java并发并发编程中的线程同步工具类,基于AQS(java.util.concurrent.locks.AbstractQue ...
- Qt+MPlayer音乐播放器开发笔记(二):交叉编译MPlayer以及部署到开发板播放演示
前言 在ubuntu上arm交叉编译MPlayer播放器,并部署到开发板播放音乐. Demo Mplayer MPlayer是一款开源多媒体播放器,以GNU通 ...
- __set_name__魔法方法
介绍 __set_name__ 方法是 Python 3.6 中引入的一种特殊方法,它可以在类属性被赋值时自动调用.这个方法可以用来处理类属性的名称绑定问题,例如将类属性与其所在的类进行绑定. 具体来 ...
- 类型判断,代码块,流程控制及循环---day05
1.类型判断isinstance 用来做判断类型 语法: 用法一: isinstance(要判断的值,要判断的类型) 返回的是真或者假 用法二: isinstance(要判断的值,(可能的类型))如果 ...
- mysql-对应删除 dict 脚本
-- 1. 此 dict 是在不同租户下的数据字典,查询时需要根据 departid 进行分类查询 -- 2. 删除dict, dict分类主表类型与挂载的子表数据 -- 3. 通过查询到的主表的 g ...
- redis分片sharding实现原理
为什么集群? 通常,为了提高网站响应速度,总是把热点数据保存在内存中而不是直接从后端数据库中读取.Redis是一个很好的Cache工具.大型网站应用,热点数据量往往巨大,几十G上百G是很正常的事儿,在 ...
- 3、mysql定位低效率执行SQL
可以通过以下两种方式定位执行效率较低的 SQL 语句. 慢查询日志 : 通过慢查询日志定位那些执行效率较低的 SQL 语句,用--log-slow-queries[=file_name]选项启动时,m ...