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 02 Answers
Reset to default 6Make 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
版权声明:本文标题:javascript - Best way to prevent a node_modules package from updating - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744729604a2621968.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论