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

yarn silently deletes packages with .git directory in node_modules on add #6504

Open
pdxjohnny opened this issue Oct 5, 2018 · 2 comments
Open

Comments

@pdxjohnny
Copy link

BUG

What is the current behavior?

/me is working on dependency of $package checked out to $PWD/node_modules/$dep
/me $ yarn add chart.js
/yarn rm -rf $PWD/node_modules/$dep
/yarn oh gee just deleted everything you hadn't pushed yet bummer huh

What is the expected behavior?

/me is working on dependency of $package checked out to $PWD/node_modules/$dep
/me $ yarn add chart.js
/yarn rm -rf $PWD/node_modules/$dep -i <- hey I'm about to nuke all your work. Should I do that?

@Kocal
Copy link

Kocal commented Oct 6, 2018

You should not update code in node_modules in this way.
If you want to, use yarn link

@pdxjohnny
Copy link
Author

Would there be receptiveness to a PR making yarn warn before deletion, giving user the option to back out of an add and telling them to link if their changes are intentional.

@arcanis arcanis changed the title YARN SILENTLY DELETES PACKAGES WITH .git DIRECTORY IN NODE_MODULES ON ADD yarn silently deletes packages with .git directory in node_modules on add Oct 10, 2018
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

2 participants