当前位置:网站首页>npm的身份证和依赖
npm的身份证和依赖
2022-07-27 16:20:00 【敢问】
npm的身份证和依赖
从npm上下载的node_modules文件夹内容称之为“依赖”;
使用package.json去管理这些依赖,需要创建自己的身份证
在开发项目的时候第一件事就是要创建身份证
npm init

填完信息 回车 创建出 package.json 文件如下

此时会填写一些表单信息包括你的名字、版本号、描述、入口文件、测试命令、git仓库、关键词、作者、版权协议
可以按需回答,也可以直接回车什么都不输入
此时就完成了创建
有了这个身份证后,以后安装依赖的时候要加—save
比如按装nzh模块

solarlunar模块
![]()
此时的 package.json 发生变化

node_modules都是相互依赖的,所以如果引入的模块特别多,此时如果进行物理文件传输的时候会造成特别大,特别碎的文件内容,可以不传这个node_modules文件夹,只传身份证;所以一定要用身份证保存,下一次进行使用的之前,重新安装
以后你只要在对应的package.json 目录下输入
npm isntall此时NodeJS和npm就会检索对应目录下面的package.json文件内部的dependencies的依赖项然后进行安装
边栏推荐
- js中的函数与DOM获取元素和事件属性的使用
- Join query and subquery
- How to send external mail to the company mailbox server on the Intranet
- TypeError: conv2d(): argument ‘padding‘ (position 5) must be tuple of ints, not str【报错】
- Wechat applet multi file upload
- Have you ever stumbled on MySQL's order by
- MySQL 01 关系型数据库设计
- 模仿线程扣除
- Must the MySQL query column be consistent with the group by field?
- 图文结合,完美解释MySQL逻辑备份的实现流程
猜你喜欢

Knowledge map - Jieba, pyhanlp, smoothnlp tools to realize Chinese word segmentation (part of speech)

百度地图技术概述,及基本API与WebApi的应用开发

Vue uses keep alive to realize page caching

Uni app label jump

Multifunctional wireless remote control moxibustion instrument chip dltap703sd

百度地图鹰眼轨迹服务

How to realize the full-text content retrieval of word, PDF and txt files?

迷你洗衣机触摸芯片-DLT8MA12TS-杰力科创

商品推荐和分类商品推荐

【npm】 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
随机推荐
文件的上传和下载
Uniapp H5 cross domain problem
Ant privacy computing innovation tee technology has won academic recognition
Runtimeerror: output with shape [1, 256, 256] doesn't match the broadcast shape [3, 256, 256] [error]
Conflict between blur event and click event in input box
Hash、Set、List、Zset、BitMap、Scan
Uni app form submit button send request
Zhaoqi scientific and technological innovation introduces high-level talents at home and abroad and connects innovation and entrepreneurship projects
Hbuilder submission code
TS study notes class
V-bind and V-for
内网的公司邮箱服务器怎么发外部邮件
Vue uses keep alive to realize page caching
地图找房的实例
Basic operations of MySQL view
MySQL set validate_ Adding skip grant tables after password=off failed to start the service
Uni app label jump
Mode= "widthfix" attribute in image tag
Wechat applet obtains mobile number
ERROR 1366 (HY000): Incorrect string value: ‘\xE8\xB5\xB5\xE9\x9B\xB7‘ for column ‘s_ name‘ at row 1