npm和yarn

全局操作

npm 加参数 -g/–global

yarn 加参数 global

查看npm包

1
2
3
4
5
6
npm list
npm list --depth=0
npm list --depth=0 --global

yarn list
yarn list global

安装npm包

1
2
3
4
npm install
npm i

yarn add

删除npm包

1
2
3
npm uninstall <package>

yarn remove <package>

更新npm包

1
2
3
4
5
npm install <package>@latest
npm update <package>

yarn add <package>
yarn upgrade <package> --latest

配置镜像

1
2
3
4
5
npm config set registry https://registry.npm.taobao.org

yarn config set registry https://registry.npm.taobao.org -g

yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
Yvan Zhu wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
0%