"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Adding Edited Node Modules to the deployment.

Adding Edited Node Modules to the deployment.

Published on 2024-11-08
Browse:123

What is problem with editing the node modules?
Let's say you want to make changes to a module and you got that file and make changes and everything seems to work fine in localhost. But when you push the website to github, the node modules do not do get uploaded. So when the website is deployed you might face errors.

The way to tackle this issue one can something like a patch-package.
patch-package allows you to modify the code in the node_modules` directory, in the form of patches. The usage was quite simple too.

Install the patch-package module.

npm i patch-package

Make changes to the node-module locally.

Now to make a patch of any of the node module, run the following command

npx patch-package 'module-name'

This will make a patches folder containing the patch of the specific module.

Adding Edited Node Modules to the deployment.

Now if you push the repo to deployment, you will find everything working fine.

Thanks for reading. Do like the post and do share your thoughts in the comment section.

`

Release Statement This article is reproduced at: https://dev.to/pankaj_singh_3986f6a48897/adding-edited-node-modules-to-the-deployment-60k?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3