当前位置:网站首页>一锅乱炖,npm、yarn cnpm常用命令合集
一锅乱炖,npm、yarn cnpm常用命令合集
2022-07-07 17:29:00 【麦洛_】
1.配置镜像
npm config get registry // 查看npm当前镜像源
npm config set registryhttps://registry.npmmirror.com/ // 设置npm镜像源为淘宝镜像
yarn config get registry //查看yarn当前镜像源
yarn config set registry https://registry.npmmirror.com/ // 设置yarn镜像源为淘宝镜像
2.依赖安装
2.1 npm&cnpm
npm install xxx 也被简写成 npm i xxx 这是最常见的下载方式,它会把包安装到当前目录下的node_modelus中
npm install [email protected]1.x.x 可以精确安装到某个版本
npm install --save xxx 也被简写成 npm install -s xxx 这种方法会将下载的模块信息写入到 package.json 中的dependencies列表中
npm install --save-dev xxx 也被简写成 npn install -D xxx 这种方法会将下载的模块信息写入到 package.json 中的devDependencies列表中 与第二种方法相比dependencies 是运行时的依赖,而devDependencies是开发时的依赖。也就是说,采用 --save-dev 安装的包我们发布后是用不到的,只有在开发时用到
npm install -g xxx 会将模块安装到全局,也就是上文配置的全局路径下
使用 npm uninstall xxx 或 npm uninstall -g xxx 可卸载模块,如全部卸载则使用 npm uninstall -all
2.2 yarn
yarn add package-name安装包的“最新”版本。
yarn add package-[email protected]1.2.3从注册表安装特定版本的包。
yarn add package-[email protected]安装特定的 “标签”(例如beta、next或latest)。
边栏推荐
- How to share the same storage among multiple kubernetes clusters
- 网信办公布《数据出境安全评估办法》,9 月 1 日起施行
- Unable to link the remote redis server (solution 100%
- LeetCode 497(C#)
- UCloud是基础云计算服务提供商
- 杰理之关于 TWS 配对方式配置【篇】
- AD域组策略管理
- ES6笔记一
- [HDU] 5248 sequence transformation (greedy + dichotomy) [recommended collection]
- 银行理财产品怎么买?需要办银行卡吗?
猜你喜欢

2022.07.04

Zhong Xuegao wants to remain innocent in the world

Install mysql8 for Linux X ultra detailed graphic tutorial

Numpy——axis

超分辨率技术在实时音视频领域的研究与实践

Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers
![Jerry's headphones with the same channel are not allowed to pair [article]](/img/7d/3dcd9c7df583944e1d765b67543eb1.png)
Jerry's headphones with the same channel are not allowed to pair [article]

Redis master-slave and sentinel master-slave switchover are built step by step

杰理之手动配对方式【篇】

2022上半年朋友圈都在传的10本书,找到了
随机推荐
Draw squares with Obama (Lua)
LeetCode 535(C#)
【Confluence】JVM内存调整
AD域组策略管理
Borui data was selected in the 2022 love analysis - Panoramic report of it operation and maintenance manufacturers
Redis master-slave and sentinel master-slave switchover are built step by step
R语言使用ggplot2函数可视化需要构建泊松回归模型的计数目标变量的直方图分布并分析构建泊松回归模型的可行性
2022.07.02
2022.07.02
[Verilog advanced challenge of Niuke network question brushing series] ~ multi bit MUX synchronizer
648. 单词替换
Policy mode - unity
杰理之手动配对方式【篇】
ES6 note 1
爬虫实战(七):爬王者英雄图片
2022上半年朋友圈都在传的10本书,找到了
ES6笔记一
国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌
Version 2.0 of tapdata, the open source live data platform, has been released
吞吐量Throughout