Home >Web Front-end >JS Tutorial >Adding Edited Node Modules to the deployment.

Adding Edited Node Modules to the deployment.

Linda Hamilton
Linda HamiltonOriginal
2024-10-02 18:19:29816browse

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.

`

The above is the detailed content of Adding Edited Node Modules to the deployment.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn