Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn那些事儿 #71

Open
FrankKai opened this issue Jun 4, 2018 · 2 comments
Open

yarn那些事儿 #71

FrankKai opened this issue Jun 4, 2018 · 2 comments

Comments

@FrankKai
Copy link
Owner

FrankKai commented Jun 4, 2018

  • 常用yarn命令总结
  • yarn使用经验
@FrankKai
Copy link
Owner Author

FrankKai commented Jun 4, 2018

常用yarn命令小结

  • 安装全局包
    yarn global add @vue/cli
  • 查看全局安装包
yarn global bin
cd usr/local/bin
ls
  • 删除全局包
yarn global remove @vue/cli
  • 升级单个包
yarn upgrade @vue/cli
  • 删除本地的某个包
yarn remove umi
  • 添加devDependencies
yarn add umi --dev/-D
  • 清除缓存
yarn cache clean

@FrankKai
Copy link
Owner Author

FrankKai commented Jun 24, 2019

yarn使用经验

yarn更新包但package.json不同步更新

yarn upgrade axios@^0.18.1 (指定版本更新就行了,仅仅yarn upgrade axios不行)

Package.json中锁了某个npm包的版本,npm包升级以后,重新yarn,会升级到最新版本吗?

要看是否有lock,有的话不会,会锁定;没有的话,会升级。

如果在lock的情况下去升级包,如何去做?

yarn upgrade [package]@[version] 或者 删除yarn.lock,重新yarn install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant