当前位置:网站首页>npm and package.json
npm and package.json
2022-08-02 03:39:00 【cjx177187】
npm:
提供项目中模块/插件的 下载相关功能
在生成的package.jsonfile to download
下载(常用)
npm i/install 模块名字/模块名字@版本号
举例:
npm i [email protected]
npm i 模块名 ====>安装到本地
npm i 模块名 -g=====>安装到全局
npm i 模块名 --save=====>安装到项目依赖
运行:
npm run 指令名=====>运行文件
指令名是package.json文件中scriptThe run attribute name of our custom file in
更新/删除
npm update 模块名 ====>帮你更新到最新版本
npm update 模块名@版本 ====>帮你更新到指定版本
npm uninstall 模块名 =====>删除模块
package.json 文件:
每一个项目 构建时 先构建一个package.jsonfile which represents some structure and configuration information for this project(项目的清单),All you need is this file and your own source code when migrating a project.
构建指令:
在项目文件夹下
npm init===>创建json文件,You will be asked for the project name in turn,版本号,Main file and other various information.
npm init -y====>自动Initialize a project manifest file,No need to fill it out again,default all
注意:生成package.jsonThe file name must be in English,The folder name is used in Chinesenpm int-y会报错
npm i =====>是按照项目清单文件去安装所有的依赖项,会在项目文件夹中生成一个node_modules文件夹,Inside are the dependencies we need;在package.json文件中添加一个dependencies属性,Add some dependency modules we need inside,包括版本号.
当然package.jsonThe modules in will also depend on some modules,These modules are therepackage_lock.json文件中.This file is of no real use,可以没有.
自定义模块
import 是es6的语法 ==>导出 export defualt xxx
require是nodeunderstandable grammar==>导出 moudel.exports={}
边栏推荐
- sh: 1: curl: not found
- Cut out web icons through PS 2021
- require modular syntax
- STM32 触发HardFault_Handler如何查找原因
- ---静态页面---
- np.unique()函数
- 解决glob()返回文件排序不一致问题&onnx本地按照安装方法
- 暴力方法求解(leetcode14)查找字符串数组中的最大公共前缀
- Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
- 最新,每天填坑,Jeston TX1 精卫填坑,第一步:刷机
猜你喜欢
URL URL
C语言 0长度数组/柔性数组
How to check whether a table is locked in mysql
磷脂-聚乙二醇-巯基,DSPE-PEG-Thiol,DSPE-PEG-SH,MW:5000
Problems when yolov5 calls ip camera
磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000
DSPE-PEG-DBCO Phospholipid-Polyethylene Glycol-Dibenzocyclooctyne A Linear Heterobifunctional Pegylation Reagent
活体检测 Adaptive Normalized Representation Learning for GeneralizableFace Anti-Spoofing 阅读笔记
客户评分控件
骨架效果 之高级渐变,适用图片等待时
随机推荐
js 取字符串中某位置某特征的值,如华为(Huawei)=>华为
A senior test engineer asked me these questions as soon as the interview came
AttributeError: Can't get attribute 'SPPF' on
Deveco studio 鸿蒙app访问网络详细过程(js)
sh: 1: curl: not found
每天填坑,精卫填坑第二集,TX1 配置从固态启动,安装Pytorch
docker 安装 sqlserver中的坑点
URL module
枚举法方法:(leetcode1300)转变数组后最接近目标值的数组和
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
Detailed explanation of the usage of exists in mysql
动态代理工具类
subprocess.CalledProcessError: Command 'pip install 'thop'' returned non-zero exit status 1.
__dirname
Redis simple study notes
云服务器安装部署Nacos2.0.4版本
docker中配置mysql 5.7
亚马逊卖家怎么提升转化率
getattr()函数解析
C语言入门小游戏—三子棋