Command Comparation

作用npmYarn
安装npm install(i)yarn
卸载npm uninstall(un)yarn remove
全局安装npm install xxx –-global(-g)yarn global add xxx
安装包npm install xxx –save(-S)yarn add xxx
开发模式安装包npm install xxx –save-dev(-D)yarn add xxx –dev(-D)
更新npm update –saveyarn upgrade
全局更新npm update –globalyarn global upgrade
卸载npm uninstall [–save/–save-dev]yarn remove xx
清除缓存npm cache cleanyarn cache clean
重装rm -rf node_modules && npm installyarn upgrade

Reference

https://blog.csdn.net/qq_40963664/article/details/82768227