admin管理员组

文章数量:1389812

I have downloaded/installed a node_module (npm package)... I have played around with the internal files to suit my needs inside the node_modules folder. It is the most convenient for me to just use it as a node_module, but I'm worried that the next time I update npm packages it might update and erase all of the changes I have made. What is the best way to make sure only that particular package should not be updated?

Thank you very much

I have downloaded/installed a node_module (npm package)... I have played around with the internal files to suit my needs inside the node_modules folder. It is the most convenient for me to just use it as a node_module, but I'm worried that the next time I update npm packages it might update and erase all of the changes I have made. What is the best way to make sure only that particular package should not be updated?

Thank you very much

Share Improve this question asked Mar 18, 2020 at 2:52 prestonpreston 4,36710 gold badges54 silver badges89 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 6

Make the version of that package specific in package.json file. For example you manually added 3.0.0 version of express in dependencies or devDependencies, change the entry of express as:

"express":"3.0.0"

You can store your own/modified packages either locally (e.g. in a mon place outside of the project) or in the cloud (e.g. GitHub) and then reference the package via the file path or repository URL respectively.

Check here:

  • local paths

  • Git URLs as Dependencies

本文标签: javascriptBest way to prevent a nodemodules package from updatingStack Overflow