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 ...
随机推荐
- 无 dmp 文件的情况下使用 windbg
项目线上出现了闪退问题,查看日志发现是 sentry 模块出问题了 因为用户电脑上没有 pdb 文件,所以无法加载具体函数的调用位置,只能手动去计算 具体步骤是:在 windbg.exe 中加载 se ...
- C++ 多线程的错误和如何避免(6)
加锁的临界区要尽可能的紧凑和小型 问题分析: 当一个线程在临界区内执行时,所有其他试图进入临界区的线程都会被阻止,所以我们应该保证临界区尽可能的小.比如, void CallHome(string m ...
- OpenCV开发笔记(五十七):红胖子8分钟带你深入了解直方图反向投影(图文并茂+浅显易懂+程序源码)
若该文为原创文章,未经允许不得转载原博主博客地址:https://blog.csdn.net/qq21497936原博主博客导航:https://blog.csdn.net/qq21497936/ar ...
- 03-Redis系列之-高级用法详解
慢查询 生命周期 我们配置一个时间,如果查询时间超过了我们设置的时间,我们就认为这是一个慢查询. 慢查询发生在第三阶段 客户端超时不一定慢查询,但慢查询是客户端超时的一个可能因素 两个配置 slowl ...
- 【Azure API 管理】APIM服务资源删除后,为什么不能马上创建相同名称的APIM服务呢?
问题描述 使用Azure APIM服务,在删除旧资源准备新建相同名称的新APIM服务时,尝试多次都是出现"指定的服务名称已正在使用"错误.但实际上同名称的服务已经被删除.为什么多次 ...
- Java 多线程------例子(1) --创建 三个窗口 买票 总票数为 100张 使用继承Thread类的方式
1 package com.bytezero.threadexer; 2 3 4 5 /** 6 * 7 * 创建 三个窗口 买票 总票数为 100张 使用继承Thread类的方式 8 * @auth ...
- redis迁移同步工具-redis-shake
官方文档: https://github.com/alibaba/RedisShake/wiki/快速开始:数据迁移 下载: https://github.com/alibaba/RedisShake ...
- arch安装discover ——KDE商店
yay -S discover sudo pacman -S archlinux-appstream-data packagekit-qt5 flatpak fwupd 安装完就可以使用KDE商店了
- SpringSecurity(7)--- Security+JWT搭建简单的授权服务器和资源服务器
Security+JWT搭建简单的授权服务器和资源服务器 之前有两篇博客分别将来介绍了 OAuth 2.0 和 JWT 1.OAuth 2.0详解 2.SpringSceurity(6)---JWT详 ...
- 高校刮起元宇宙风!3DCAT实时云渲染助力川轻化元校园建设
元宇宙,是一个虚拟的网络世界,它与现实世界相互连接,为人们提供了一个身临其境的数字体验.元宇宙的概念并不新鲜,早在上个世纪就有科幻作家和电影导演对它进行了想象和创造.但是,随着科技的发展,特别是5G. ...