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

Evaluate not removing node_modules after git merge #586

Closed
Tracked by #603
tschaffter opened this issue Aug 21, 2022 · 1 comment · Fixed by #604
Closed
Tracked by #603

Evaluate not removing node_modules after git merge #586

tschaffter opened this issue Aug 21, 2022 · 1 comment · Fixed by #604
Assignees

Comments

@tschaffter
Copy link
Member

The article Safer Node.js coding with git hooks and husky suggest to remove node_modules and do a fresh install of Node.js dependencies after merging a branch. This operation is time consuming and in #580 I decided to skip this step.

I contacted the author of the article for more info and he replied the following:

With post-merge, we're doing a full reinstall of all node modules by first deleting them, because I have seen yarn 1.x often break when deep transitive dependencies change during a merge specifically. I don't know why this happens, exactly. It is also valid to omit this hook, and let developers run "yarn install" manually.

A few weeks ago I tried to skip removing node_modules after merge but encountered an issue: I think that the command yarn or nx was not longer available? I was in the middle of another task so I reverted back.

The goal of this ticket is to try to briefly reproduce the error I encountered or any error that may result from no longer removing node_modules after merge. Upgrading to Yarn 3 or pnpm is also considered but as a parallel solution.

@tschaffter
Copy link
Member Author

The section How to fix yarn.lock merge conflicts of this article is relevant to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant