javascript - Best way to prevent a node_modules package from updating - Stack Overflow

I have downloadedinstalled a node_module (npm package)...I have played around with the internal files

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744729604a4590387.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信