当前位置:网站首页>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参数aliasa 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]
同步模块
直接通过synccommand to synchronize a module at once, 只有cnpmThis 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开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担.添加下方名片,即可获取全套学习资料哦
边栏推荐
- mysql remove duplicate data
- MySQL 8.0.29 设置和修改默认密码
- mysql去除重复数据
- Enhancing Quality for HEVC Compressed Videos
- 关于MySQL主从复制的数据同步延迟问题
- How do I refresh the company's background management system (Part 1) - performance optimization
- Motion Tuned Spatio-temporal Quality Assessmentof Natural Videos
- cnpm安装步骤
- The structure of knowledge in the corners of the C language
- ClickHouse to create a database to create a table view dictionary SQL
猜你喜欢
随机推荐
系统结构考点之并行主存
mysql去除重复数据
【菜鸡含泪总结】如何用pip、anaconda安装库
How strict Typescript strict mode?
对List集合中每个对象元素按时间顺序排序
MySQL 游标
Google Earth Engine ——ee.List.sequence函数的使用
Markdown的使用
mysql deadlock
cnpm的安装与使用
MySQL删除表数据 MySQL清空表命令 3种方法
Google Earth Engine ——快速实现MODIS影像NDVI动画的在线加载并导出
Outsourcing worked for three years, it was abolished...
走进Redis,让你重新认识redis。绝不是表面
Union, the difference between union and structure, the knowledge of enumeration of C language corners
go慢速入门——函数
kubernetes
基于ABP实现DDD--领域服务、应用服务和DTO实践
【信息安全技术】RSA算法的研究及不同优化策略的比较
数据指标口径不统一、重复开发?亿信ABI指标管理平台帮你解决









