-2

I have made changes in an NPM package. How can I avoid those changes going back to normal if somebody does npm install? I don't want any changes in a specific package if somebody does npm install. I did npm install and all changes made manually were reverted.

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
  • 1
    How are they going to get access to your modified version of the package? Maybe you could make a fork, publish and install that fork instead? – jonrsharpe Nov 08 '21 at 13:14
  • 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) – jonrsharpe Nov 08 '21 at 13:19

1 Answers1

1

You can create a PR in the package repository, and expect the author to approve it.

When you locally change the package content inside your node_modules, it's going to be overwritten by npm install.

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
Tiko
  • 941
  • 8
  • 17