当前位置:网站首页>npm指令
npm指令
2022-07-30 07:12:00 【时刃风飞】
一、npm
1、why
JavaScript项目包管理工具,管理插件与下载插件的;cnpm yarn同类型产品
2、初始化
npm init 初始化项目;创建package.json的文件(只按回车),
npm init -y 快捷初始化项目 (选项都为yes)
3、目录解释
1.package.json 项目包管理文件
2.package-lock.json 下载缓存地址
3.node_modules 安装包下载的位置
4、安装 install
1.普通安装 安装jquery npm i jquery
2.全局安装 电脑的任何项目都可以引用到安装的插件
全局安装vue npm i @vue/cli -g;插件全局安装的位置 npm root view -g
3.开发依赖安装 安装的插件在项目开发阶段使用,上线就不需要了
开发依赖安装 axios npm i axios -D
4. 产品依赖安装 安装的插件在开发与线上阶段都需要
产品环境依赖安装 jquery npm i jquery -S
别名/简写
install --> i
全局:--global 简写为 -g
开发:--save-dev 简写为 -D
产品:--save 简写为 -S
5、卸载
卸载jquery npm uninstall jquery
别名(简写) uninstall --> remove --> r
6、安装固定版本
安装固定版本 2.1版本jquery npm i [email protected]
7、更新
npm update jquery 更新jquery 别名 update --> up
8、版本号
"jquery": "3.6.0" 限定版本范围,项目使用jquery可以升级的方法不但能大于等于4.0.0
"jquery": "2.1" 固定版本为2.1
X,Y,Z
X大版本,X的升级是不兼容的,3.6.0 -->4.0.1 使用3.6.0的项目和现在的4.0.1的项目 是不兼容
Y 中版本,Y的升级是代表有个新的内容增加(兼容的)
Z 小版本,通常修复bug错误的
边栏推荐
- SE11 创建搜索帮助
- Selected as one of the "Top Ten Hard Core Technologies", explaining the technical points of Trusted Confidential Computing (TECC) in detail
- RFID固定资产盘点系统给企业带来哪些便利?
- IDEA设置System.out.println()和main方法快捷键
- Max Sum Plus Plus HDU - 1024
- DP5340 domestic replacement for CM5340 stereo audio A/D converter chip
- MagicDraw二次开发过程
- C语言力扣第46题之全排列。回溯法
- 立创EDA——PCB的走线(五)
- SQL row-column conversion
猜你喜欢
随机推荐
redis常用指令
Fix datagrip connection sqlserver error: [08S01] The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption.
IDEA search plug-in has no results and the solution has been spinning in circles
2020 ACM | MoFlow: An Invertible Flow Model for Generating Molecular Graphs
MagicDraw二次开发过程
你好,我的新名字叫 “铜锁 / Tongsuo”
typescript6 - simplify the steps to run ts
What convenience does the RFID fixed asset inventory system bring to enterprises?
「活动推荐」探索未来:数字科技
redis多节点部署实施指引
Get all interface paths and names in the controller
SkiaSharp 之 WPF 自绘 拖曳小球(案例版)
数据分发服务 (DDS) 内置主题
42.【vector简单列题】
用代码收集每天热点内容信息,并发送到自己的邮箱
elk报错:[syslogs] index has exceeded [1000000]
k8s 部署mysql8(PV和PVC 版本)
C# uses RestSharp to implement Get, Post requests (2)
Risk Register
SQL注入漏洞(postgresql注入)








