包指令
快速创建package.json
npm init
安装一个包
npm i xxx 或者 npm install xxx
安装多个包
npm i xxx1 xxx2 或者 npm install xxx1 xxx2
卸载包
npm uninstall xxx
安装指定的包,并记录到 devDependencies 节点中
npm i 包名 -D, 完整写法 npm install 包名 --save-dev
切换 npm 的下包镜像源
# 查看当前的下包镜像源
npm config get registry
# 将下包的镜像源切换为淘宝镜像源
npm config set registry=https:
# 检查镜像源是否下载成功
npm config get registry
使用 nrm 切换下载包的服务器
npm i nrm -g
nrm ls
nrm use taobao
i5ting_toc 实现md转html 的功能
i5ting_toc -f 要转化的md文件路径 -o
注册 npm 账号
- 访问 npm 网站,点击
sign up 按钮,进入注册用户界面
- 填写账号相关的信息:
Full Name、Public Email、Username、Password
- 点击
Create an Account 按钮,注册账号
- 登录邮箱,点击验证链接,进行账号的验证
登录 npm 账号
npm login
把包发布到 npm上
npm publish
删除已发布的包
npm unpublish 包名 --force