Knowledgebase
Reinstalling Node.js modules is a common troubleshooting step used to resolve issues caused by corrupted dependencies, failed installs, or mismatched versions.
This process fully removes existing modules and reinstalls them based on the package.json file, ensuring a clean and consistent dependency state.
Reinstalling node modules is recommended when:
The application fails to start after updates
Errors reference missing or incompatible packages
Dependencies behave unexpectedly
Build or runtime issues appear without clear cause
Open a terminal and navigate to the root directory of the application:
cd /path/to/applicationOn Weblutions products the directory is usually in the /home. For example /home/faxstore
Delete the node_modules folder and package-lock.json file to ensure all dependencies are reinstalled from scratch:
rm -rf node_modules package-lock.jsonRun the install command to reinstall all dependencies defined in package.json:
npm installThis will download and rebuild all required packages based on the latest compatible versions defined in the package.json.
Now start the application as per normal node . and if issues continue to persist the optional steps below may of assistance for further trouble-shooting of the application.
The cache for the Node Package Manager (NPM) can at times cause issues with package downloads, especially if Node.js has been installed for some time.
Before cleaning the Node.js cache steps one and two from the above must be completed.
To clean the cache the clear cache command can be ran on the server.
npm cache clean --forceOnce the cache has been cleaned the node modules can be reinstalled with the install command.
npm installFurther, Node.js can be completely reinstalled with a program like Node Version Manager (NVM), for more information for that process see the Using Node Version Manager Guide.
If further issues persist, it's recommended to contact Weblutions if this is in relation to a Weblutions product.