yarn remove
yarn remove <package...>
运行 yarn remove foo 会从你的直接依赖里移除名为 foo 的包,在此期间会更新你的 package.json 和 yarn.lock 文件。
此项目上工作的其他开发者可以运行 yarn install 来同步他们的 node_modules 目录为新的依赖集。
当你移除一个包时,它被从所有类型的依赖里移除:dependencies、devDependencies 等等。
注意:
yarn remove总是会更新你的package.json和yarn.lock。 这可以确保不同的开发人员在同一个项目上得到相同的依赖集。 不可能禁止这个行为。Note:
yarn remove <package> --<flag>uses the sameflags asyarn installcommand.