Search code examples
javascriptnode.jsyarnpkg

Are there any hooks for the `yarn remove [package]` command? (Hooks similar to postinstall)


I need to run a script after

  • yarn add [package]
  • yarn remove [package]
  • yarn upgrade [package]
  • yarn install

postinstall is triggered after yarn add, yarn upgrade and yarn install. However, it does not seem to work with yarn remove. Any ideas?


Solution

  • Not supported by Yarn v1, Yarn v2 supports this now.

    https://github.com/yarnpkg/yarn/issues/8547#event-4202158721 https://github.com/yarnpkg/yarn/issues/8498#event-4202173689