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

Add postupgrade hook after yarn upgrade is run #8498

Closed
matty-liu opened this issue Dec 11, 2020 · 3 comments
Closed

Add postupgrade hook after yarn upgrade is run #8498

matty-liu opened this issue Dec 11, 2020 · 3 comments

Comments

@matty-liu
Copy link

matty-liu commented Dec 11, 2020

Bug Description

Sorry if I am not following procedure, was looking at this issue
#2878
and saw a note that if the issue still exists to create a new ticket.

After running yarn upgrade, my postinstall script is not run.

Command

yarn upgrade

What is the current behavior?

yarn upgrade runs without trigger the postinstall script after it runs

Steps to Reproduce

Add the below script into package.json

{
  "scripts": {
    "postinstall": "echo post install script ran"
  }
}

Execute yarn upgrade.

Either behavior of having the postinstall script run after yarn upgrade or if a postupgrade hook was added that I could use to run my script would be desirable.

Environment
Node Version: 14.6.0
Yarn v1 Version: v1.22.4
OS and version: MacOS Catalina 10.15.7

@jlurena
Copy link

jlurena commented Jan 13, 2021

The same should be applied for yarn remove

@merceyz
Copy link
Member

merceyz commented Jan 13, 2021

Closing as fixed in v2 where the postinstall script is called whenever the dependency tree of your workspace changes

https://yarnpkg.com/getting-started/migration

@merceyz merceyz closed this as completed Jan 13, 2021
@klemenoslaj
Copy link

@merceyz could we get the fix to v1 as well?

A lot of repositories are still unable to move to v2 so I wonder if such issues should really be just closed?
In other words, you're alienating a lot of repositories, forcing people to work around yarn v1 issues or alternatively migrate back to npm.

mrienstra added a commit to mrienstra/berry that referenced this issue Sep 12, 2021
arcanis added a commit to yarnpkg/berry that referenced this issue Sep 16, 2021
* docs: postinstall runs for any change

As per yarnpkg/yarn#8498 (comment)

* Wording tweak

* Update lifecycle-scripts.md

Co-authored-by: Maël Nison <nison.mael@gmail.com>
arcanis added a commit to yarnpkg/example-repo-zipn that referenced this issue Jul 3, 2023
* docs: postinstall runs for any change

As per yarnpkg/yarn#8498 (comment)

* Wording tweak

* Update lifecycle-scripts.md

Co-authored-by: Maël Nison <nison.mael@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants