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.
Asked
Active
Viewed 94 times
-2

jonrsharpe
- 115,751
- 26
- 228
- 437

Sambhav Jain
- 19
- 1
-
1How 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 Answers
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
- 115,751
- 26
- 228
- 437

Tiko
- 1,241
- 11
- 19
-
-
That's going to depend largely on what change you're making - it might not be something the maintainers will accept. – jonrsharpe Nov 08 '21 at 13:21