Yarn "prepare" task fails with command not found #9447
Unanswered
amuttsch
asked this question in
Request Help
Replies: 2 comments 5 replies
-
I think you don't want to run husky on renovate, so configure ignoreScripts=true. if you need to run husky configure skipInstalls=false, so the yarn command is not optimized and does a full install. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Is there a reason to use |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What Renovate type, platform and version are you using?
Self-hosted on GitLab using
renovate/renovate:24.104.1-slim
docker image.Describe the bug
We have a
yarn
repository that recently updatedhusky
to v6. From this version aprepare
task is added automatically to activate any git hooks after theyarn install
is done. This causes renovate bot to fail with anartifact error
, as it doesn't findhusky
when creating a PR.Relevant debug logs
Have you created a minimal reproduction repository?
Yes: https://gitlab.com/amuttsch_cc/renovate-yarn-husky
It contains the renovate configuration, CI job that triggers renovate as well as the minimal
package.json
. You also find the MR with the error and the pipeline with debug logs above.Additional context
We also tested if
binarySource: 'docker'
caused this issue. We removed it and it still causes this problem.The issue only arises when renovate is creating a MR. If, for example, the hourly MR limit is reached, the error does not arise in the logs.
It seems like the
yarn install
is patched before executing:sed -i 's/ steps,/ steps.slice(0,1),/' /home/ubuntu/.npm-global/lib/node_modules/yarn/lib/cli.js
This leads to the following output:
It only resolves packages, but is not fetching and installing anything.
If we understand this correctly it just resolves packages and saves the lock file. This does not install any dependencies, but it still executed the
prepare
command. Since it didn't install anything,husky
cannot be executed.Documentation about the
prepare
task: https://classic.yarnpkg.com/en/docs/package-json/#toc-scriptsI think a check in the prepare if
husky
exists can be a workaround for this issue.Beta Was this translation helpful? Give feedback.
All reactions