当前位置:网站首页>Installation and use of cnpm
Installation and use of cnpm
2022-07-30 21:36:00 【bhegi_seg】
由于npmPackage managers can sometimes be unstable,It is easy to report errors when installing dependent packages,So there are Chinese developedcnpm,本人亲测,比npm稳定多了,速度还更快(Because it is a domestic source),This article will teach you a lessoncnpm如何安装,如何使用.
在安装cnpm之前,我们需要安装Node.js,使用npm安装cnpm.
什么是Node.js?
Node.js发布于2009年5月,由Ryan Dahl开发,是一个基于Chrome V8引擎的JavaScript运行环境,使用了一个事件驱动、非阻塞式I/O模型,让JavaScript 运行在服务端的开发平台,它让JavaScript成为与PHP、Python、Perl、Ruby等服务端语言平起平坐的脚本语言.
Node.js对一些特殊用例进行优化,提供替代的API,使得V8在非浏览器环境下运行得更好,V8引擎执行Javascript的速度非常快,性能非常好,基于Chrome JavaScript运行时建立的平台, 用于方便地搭建响应速度快、易于扩展的网络应用.
什么是npm?
NPM的全称是Node Package Manager,是一个NodeJS包管理和分发工具,已经成为了非官方的发布Node模块(包)的标准.
2020年3月17日,Github宣布收购npm,GitHub现在已经保证npm将永远免费.
什么是cnpm?
这是一个完整npmjs.org
镜像,你可以用此代替官方版本(只读),同步频率目前为10分钟一次以保证尽量与官方服务同步.
- 当前npmmirror.com运行版本是: [email protected]
- 本系统运行在Node.js@v16.13.2上
- 开源镜像:CNPM Binaries Mirror
- Node.js 镜像:CNPM Binaries Mirror
- alinode 镜像:CNPM Binaries Mirror
- ChromeDriver 镜像:CNPM Binaries Mirror
- OperaDriver 镜像:CNPM Binaries Mirror
- Selenium 镜像:CNPM Binaries Mirror
- electron 镜像:CNPM Binaries Mirror
如何安装Node.js和npm?
参考这篇文章:Node.js的安装与使用(npm)_的博客-CSDN博客
如何安装cnpm?
The script below can be run directly,如果安装失败的话,加一下sudo试试:
npm install -g cnpm --registry=https://registry.npmmirror.com
Or you can add it directlynpm
参数alias
a new command:
alias cnpm="npm --registry=https://registry.npmmirror.com
–cache= H O M E / . n p m / . c a c h e / c n p m − − d i s t u r l = h t t p s : / / n p m m i r r o r . c o m / m i r r o r s / n o d e − − u s e r c o n f i g = HOME/.npm/.cache/cnpm --disturl=https://npmmirror.com/mirrors/node --userconfig= HOME/.npm/.cache/cnpm−−disturl=https://npmmirror.com/mirrors/node−−userconfig=HOME/.cnpmrc"
# Or alias it in .bashrc or .zshrc
echo '
#alias for cnpm
alias cnpm="npm --registry=https://registry.npmmirror.com
–cache= H O M E / . n p m / . c a c h e / c n p m − − d i s t u r l = h t t p s : / / n p m m i r r o r . c o m / m i r r o r s / n o d e − − u s e r c o n f i g = HOME/.npm/.cache/cnpm --disturl=https://npmmirror.com/mirrors/node --userconfig= HOME/.npm/.cache/cnpm−−disturl=https://npmmirror.com/mirrors/node−−userconfig=HOME/.cnpmrc"’ >> ~/.zshrc && source ~/.zshrc
如何使用cnpm?
安装模块
cnpm install [name]
同步模块
直接通过sync
command to synchronize a module at once, 只有cnpm
This feature is only available on the command line:
cnpm sync express
当然, 你可以直接通过 web 方式来同步:/sync/express
open https://npmmirror.com/sync/express
其它命令
支持npm
除了publish
之外的所有命令, 如:
cnpm info express
以上就是我为大家带来的“cnpm的安装与使用”,If you like it, please support me with a like,谢谢!
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在.深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小.自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前.因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- cookie和session区别
- QUALITY-GATED CONVOLUTIONAL LSTM FOR ENHANCING COMPRESSED VIDEO
- [Deep Learning] Target Detection | SSD Principle and Implementation
- 3分钟带你了解微信小程序开发
- [Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery
- ELF:加载过程
- MySQL删除表数据 MySQL清空表命令 3种方法
- (7/29) Basic board minimum spanning tree prim+kruskal
- 【问题】Mysql Waiting for table metadata lock 解决方案 修改lock_wait_timeout时间
- ELF: Loading process
猜你喜欢
Detailed explanation of the delete problem of ClickHouse delete data
JUC原子类详解
ClickHouse 数据插入、更新与删除操作 SQL
[Deep Learning] Understanding of Domain Adaptation in Transfer Learning and Introduction of 3 Techniques
Solve npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead
MySQL压缩包方式安装,傻瓜式教学
kubernetes
大家都在用的plm项目管理软件有哪些
[Limited Time Bonus] 21-Day Learning Challenge - MySQL from entry to mastery
MySQL 灵魂 16 问,你能撑到第几问?
随机推荐
系统结构考点之并行主存
微信公众号授权登录后报redirect_uri参数错误的问题
LeetCode·23.合并K个升序链表·递归·迭代
MySQL cursors
mysql创建表
IDEA2018.3.5 cancel double-click Shift shortcut
走进Redis,让你重新认识redis。绝不是表面
socket: Kernel initialization and detailed process of creating streams (files)
TransGAN code reproduction - Jiutian Bisheng Platform
系统结构考点之多级混洗交换网络
活动推荐 | 2022年深圳最值得参加的边缘计算活动
HCIP第十六天
Chrome 配置samesite=none方式
LeetCode·Daily Question·952. Calculate Maximum Component Size by Common Factor·Union Check
The structure of knowledge in the corners of the C language
DPW-SDNet: Dual Pixel-Wavelet Domain Deep CNNsfor Soft Decoding of JPEG-Compressed Images
Image Restoration by Estimating Frequency Distribution of Local Patches
Markdown的使用
kubernetes
Deep Non-Local Kalman Network for VideoCompression Artifact Reduction