FIX - add npm prepare script so husky v8 is setup and stops throwing errors #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This may be a bit of trial & error, but I'm attempting to fix the tradeshift-scripts for our team. Open to better suggestions, but this works if I add the prepare statement to my team's repo. I want to test if this would work for everyone without having to update individual repos... we are all receiving errors like below since the version upgrade from 5.2.5 to 5.2.6 where husky was upgraded from ^4.0.0 to ^8.0.0
and the corresponding npm log contains:
Others on Github filed similar issue: npm/cli#1845, so Husky provided a migration CLI in their docs: https://typicode.github.io/husky/migrating-from-v4.html which suggests doing the following:
"husky init sets up Git hooks and updates your package.json scripts (you may want to commit your changes to package.json before running husky init).
husky-4-to-8 creates hooks based on your husky v4 config. If --remove-v4-config is passed, previous config will be deleted (recommended)."
Checklist: