-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Run postinstall after package upgrades #2878
Comments
@evan-scott-zocdoc is this still a problem? |
@BYK not sure, sorry. We moved off yarn internally. |
@BYK I'd say yes. It's not really a problem, it's just a nice feature that would be cool to have if there are no downsides to it. |
@jakubzitny thanks. It feels almost like a bug to me but since there are no repro steps, I can't verify this issue. Do you have a specific case at hand that you can share with us? |
Just upgrade a package that has "postinstall" defined in the You could try starting it at this commit: |
Since It should happen during the "Rebuilding all packages" phase. |
Actually, if I
( |
Closing as this was opened against a now old version of Yarn, and I was unable to reproduce with Yarn 1.3.2; the postinstall script was run when I tried to reproduce it. If someone is still having this issue with Yarn v1.3.2, please open a new issue. |
@rally25rs Please re-open, it's not solved at all. With the following configuration: "scripts": {
"postinstall": "./yarn-scripts",
"build": "encore dev",
"watch": "encore dev --watch",
"prod": "encore production"
} If I run Using last v1.3.2 version. |
I can confirm that steps to reproduce: mkdir yarn_install_scripts_test
cd yarn_install_scripts_test
echo '{
"name": "yarn_test",
"version": "1.0.0",
"scripts": {
"preinstall": "touch preinstall",
"postinstall": "touch postinstall"
}
}' > package.json
yarn add ramda@0.21
ls
rm *install
yarn upgrade ramda@0.25
ls
yarn remove ramda
ls the output of first
and for the other two:
|
Ok, it looks like I have misunderstood the purpose of the pre\postinstall scripts: they are supposed to be ran when package is installed as a dep of another package, but I was trying to use them to run some commands every time there is a modification to deps of my package ( like when adding of removing deps ). To take a step back, what I was trying to achieve is to prevent here's an example of what I would have in my package.json: {
"name": "yarn_test",
"version": "1.0.0",
"scripts": {
"preinstall": "if [ -L ./node_modules/my_module ]; then unlink ./node_modules/my_module; fi",
"postinstall": "if ! [ -L ./node_modules/my_module ]; then ln -s ../my_module/ ./node_modules/my_module; fi"
},
} But it looks like what I really need is to add the folder as link dep with |
I would like this to be reopened, since the issue was never resolved. It is not working on yarn version 1.7.1. Our usecase is to patch a library via the postinstall. This then gets overwritten everytime we run Ideally |
yarn |
Yarn 1.15.2, issue still is not resolved. |
It would help if there was a trigger for |
Please allow us to target upgrade specifically with |
i think a |
1.16.0 still presents the same defect |
I still would really like the |
Confirming that this issue still exists in 1.21.1. Please re-open and fix. |
Same in 1.22.19 |
#2878
khames
في الأربعاء، ٣٠ نوفمبر، ٢٠٢٢ ٢٢:٠١ Sergey Zolotarev <
***@***.***> كتب:
… Same in 1.22.19
—
Reply to this email directly, view it on GitHub
<#2878 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4JQRPSW53VUUJTGDPBJTMTWK6P63ANCNFSM4DDBE2KQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Do you want to request a feature or report a bug?
kind of neither, behavioral change
What is the current behavior?
After running a command like
yarn upgrade {pkg}
oryarn upgrade-interactive
, the npmpostinstall
script is not being run.What is the expected behavior?
I would expect the
postinstall
script to be run, since yarn is effectively installing an updated version of one or more packages.Please mention your node.js, yarn and operating system version.
yarn 0.21.3, mac os latest
The text was updated successfully, but these errors were encountered: