当前位置:网站首页>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={}
边栏推荐
猜你喜欢

DOM操作---放大镜案例

docker中配置mysql 5.7

yolov5调用ip摄像头时出现的问题

Debian 10 NTP 服务配置

啃瓜记录第一天

DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰活性基团

DSPE-PEG-DBCO 磷脂-聚乙二醇-二苯并环辛炔 一种线性杂双官能聚乙二醇化试剂

String comparison size in MySQL (date string comparison problem)

subprocess.CalledProcessError: Command 'pip install 'thop'' returned non-zero exit status 1.

Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG
随机推荐
How to check whether a table is locked in mysql
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/yolov5-5.0/models/commo
Error: with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory:
canvas--pie chart
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boo
Common methods of js array deduplication
The difference between the knowledge question and answer session with the knowledge
L1-043 阅览室 (20分)
Detailed explanation of the usage of exists in mysql
网址URL
Phospholipid-polyethylene glycol-hydrazide, DSPE-PEG-Hydrazide, DSPE-PEG-HZ, MW: 5000
解决glob()返回文件排序不一致问题&onnx本地按照安装方法
String comparison size in MySQL (date string comparison problem)
Phospholipid-Polyethylene Glycol-Aldehyde DSPE-PEG-Aldehyde DSPE-PEG-CHO MW: 5000
【面试】失败的一次面试
Usage of JOIN in MySQL
猴子选大王
cross-domain problem solving
一个结构体 = 另一个结构体(同类型结构体之间可直接赋值操作)
跨域问题解决