当前位置:网站首页>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={}
边栏推荐
猜你喜欢
subprocess.CalledProcessError: Command ‘pip install ‘thop‘‘ returned non-zero exit status 1.
利用 nucleo stm32 f767zi 进行USART+DMA+PWM输入模式 CUBE配置
DSPE-PEG-Silane, DSPE-PEG-SIL, phospholipid-polyethylene glycol-silane modified active group
啃瓜记录第一天
Phospholipid-polyethylene glycol-azide, DSPE-PEG-Azide, DSPE-PEG-N3, MW: 5000
Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
【装机】老毛桃的安装及使用
小程序 van-cell 换行能左对齐问题
Cut out web icons through PS 2021
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
随机推荐
磷脂-聚乙二醇-巯基,DSPE-PEG-Thiol,DSPE-PEG-SH,MW:5000
nucleo stm32 h743 FREERTOS CUBE MX配置小记录
Phospholipid-polyethylene glycol-hydrazide, DSPE-PEG-Hydrazide, DSPE-PEG-HZ, MW: 5000
querystring模块
js 取字符串中某位置某特征的值,如华为(Huawei)=>华为
STM32 CAN过滤器
配置mmdet来训练Swin-Transformer之一配置环境
kettle 安装与配置
化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000
客户评分控件
---静态页面---
[Mianjing] Mihayou data development on one side and two sides
Knowledge Engineering Assignment 2: Introduction to Knowledge Engineering Related Fields
知识工程作业2:知识工程相关领域介绍
Common methods of js array deduplication
STM32 触发HardFault_Handler如何查找原因
通过PS 2021 将网页图标抠下来
第一篇博客
parser = argparse.ArgumentParser() parsing
npm--package.json---require