[Front-end Notes] Introduction to front-end package management tools and build packaging tools: npm, yarn, webpack, vite

1. NPM package management tool

1.1, what is NPM

NPM (Node Package Manager) is the node package manager, the package management system adopted by node.js by default, written in JavaScript language. Package management can be understood as dependency management. There is an npm package management warehouse. When we execute the npm command, we can directly download the corresponding dependency package from the npm warehouse, similar to POM in back-end development.

1.2. NPM installation

NPM is already installed in node.js, so you only need to install the node.js runtime environment, and the NPM tool will be used by default.

1.3. NPM commands

(1) Install the software package

# 这里的 【-g】表示全局安装,如果不写,则默认安装在当前目录下
# -save 表示将当前软件包依赖写入到 package.json 文件中的 dependencies 节点中
# -save-dev 表示将当前软件包依赖写入到 package.json 文件中的 devDependencies 节点中
# -save 也可以缩写成 -S
npm install 安装的包名称 [-g] [-save]
npm install 安装的包名称 [-g] [-save-dev]

# 安装指定版本的软件包,已经存在了,就更新对应软件包的版本
npm in

Guess you like

Origin blog.csdn.net/qq_39826207/article/details/130414690