Node package manager npm common commands

1. Install all dependencies

npm install -g

Parameters:
-g: If you specify this parameter. npm will not install the package to a local folder, but uses a global location.

2. Install a single package

npm install <package-name>

parameter:

--save 安装并添加条目到 package.json 文件的 dependencies。
--save-dev 安装并添加条目到 package.json 文件的 devDependencies。

3. Update all updated versions that meet the version restrictions

npm update

4. Update a single package

npm update <package-name>

5. Run the task

npm run <task-name>
npm run watch
npm run dev
npm run prod

Guess you like

Origin blog.csdn.net/qq_43073558/article/details/110351305