查看 npm 版本
1 | npm -v |
初始化
1 | npm init |
安装
项目中的 package.json 文件自动给下载项目中所需的全部依赖
1 | npm install |
查看
1 | // 查看当前目录 |
更新与卸载
1 | npm update <包名> |
运行命令
1 | npm run <命令> |
更改下载源
1 | npm install -g cnpm --registry=https://registry.npmmirror.com |
缓存
1 | npm cache clean --force |
帮助
1 | npm --help |
账号
1 | // 添加账号 |
发布
1 | npm publish |
撤销发布
1 | npm unpublish <命令> |
其他
1 | // 检查依赖是否已经弃用 |