0

There is a module that I am importing in my react app and I need to tweak a few things about it. How do I do this? The module in question is "react-chess". I go to /node_modules and I put in a couple console.log's to start and nothing happens.

Bud S.
  • 69
  • 4
  • Does this answer your question? [How to edit a node module installed via npm?](https://stackoverflow.com/questions/13300137/how-to-edit-a-node-module-installed-via-npm) – Brian Thompson Dec 17 '19 at 14:45
  • Even if you got that working (which you could), you shouldn't. Anytime someone clones your project or clears `node_modules` your changes will be lost. – Brian Thompson Dec 17 '19 at 14:47
  • @Brian That doesn't solve my question because this is a react package that exports a component. I need to edit a react component in the node_modules folder. – Bud S. Dec 17 '19 at 15:47
  • That's what this answer describes. It doesn't matter if the package exports a function, a component, or whatever; It is a node module and making changes directly in node modules will almost certainly produce bugs in the future of your project because your changes will disappear unexpectedly. If you absolutely have to make changes to a package like that, then as the answer suggests - you should fork the project and reference that version instead of the public package. – Brian Thompson Dec 17 '19 at 16:11
  • @Brian that still doesn't tell me how to edit it even if I did fork it. – Bud S. Dec 17 '19 at 17:02

0 Answers0