How to resolve build:js issue

less than 1 minute read

After modifying the scripts stored in /assets/js/ ( disclaimer: not available as part of the default folder structure in Jekyll), I tried to rebuild using npm run build:js, which failed. It threw an errno 1 after code ELIFECYCLE due to a failed uglify script. To tackle it, I used the following commands:

npm cache clean --force
rm -rf node_modules
npm i

After these steps, I could run the command successfully.