All journal entries
EnvironmentNodeNPMUncategorized

Restoring Node Modules/Build To Previous State

Get the correct version of package.json AND package-lock.json files. Do not delete these or automatically regenerate the package-lock.json file. Simply use the versions from the working state. Then carry out the following commands. if you are using nvm to manage node version, ensure you have the right one selected for

Get the correct version of package.json AND package-lock.json files. Do not delete these or automatically regenerate the package-lock.json file. Simply use the versions from the working state. Then carry out the following commands.

rm -rf node_modules
npm cache clean --force

if you are using nvm to manage node version, ensure you have the right one selected for your build

source $NVM_DIR/nvm.sh && nvm use 14
npm install

You can now run your usual commands and all should work as expected. Example below.

npm run watch
npm run prod

Start a build

Tell me where work is getting stuck.

Share the process, bottleneck or idea. I'll reply with a practical first step—not a generic sales pitch.

Sent securely to my inbox. Your details are only used to reply.