当前位置:网站首页>一锅乱炖,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)。
边栏推荐
- Flipping game (enumeration)
- [tpm2.0 principle and Application guide] Chapter 9, 10 and 11
- How to estimate the value of "not selling pens" Chenguang?
- 注解。。。
- How to open an account for stock speculation? Excuse me, is it safe to open a stock account by mobile phone?
- testing and SQA_ Dynamic white box test [easy to understand]
- Key points of anti reptile: identifying reptiles
- Research and practice of super-resolution technology in the field of real-time audio and video
- Jürgen Schmidhuber回顾LSTM论文等发表25周年:Long Short-Term Memory. All computable metaverses. Hierarchical reinforcement learning (RL). Meta-RL. Abstractions in generative adversarial RL. Soccer learn
- 【牛客网刷题系列 之 Verilog进阶挑战】~ 多bit MUX同步器
猜你喜欢
随机推荐
2022.07.04
爬虫实战(七):爬王者英雄图片
Unable to link the remote redis server (solution 100%
Numpy——axis
Research and practice of super-resolution technology in the field of real-time audio and video
Numpy——axis
鸿蒙智能家居【1.0】
Solve the problem of remote rviz error reporting
Business experience in virtual digital human
LeetCode 890(C#)
博睿数据入选《2022爱分析 · IT运维厂商全景报告》
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
凌云出海记 | 赛盒&华为云:共助跨境电商行业可持续发展
SlashData开发者工具榜首等你而定!!!
现在股票开户可以直接在网上开吗?安全吗。
what‘s the meaning of inference
Key points of anti reptile: identifying reptiles
R语言ggplot2可视化:使用ggpubr包的ggstripchart函数可视化分组点状条带图(dot strip plot)、设置position参数配置不同分组数据点的分离程度
索引总结(突击版本)
L1-019 who falls first (Lua)