1. 包的初始化
npm init -y
2. 安装包
npm i 包名 # 简写
npm install 包名
npm install 包名@版本号
npm install 包名 -D # 安装开发依赖
3. 卸载包
npm uninstall 包名
4. 安装nrm
npm i nrm -g # 安装nrm用于切换镜像
nrm ls # 查看镜像列表
nrm user 镜像名字 # 设置镜像
5. 安装全局包
npm i 包名 -g
6. 卸载全局包
npm uninstall 包名 -g
7. 发布包
nrm use npm # 设置镜像为官方镜像
npm login #登录账号
logged in as 用户名 on https://registry.npmjs.org/. (登陆成功)
8. 删除包
npm unpublish 包名 --force