To fix the ‘Uncaught Error: Module did not self-register ‘ with JavaScript, we remove the node_modules folder and reinstall all the packages.
To do this, we run
rm -r node_modules
to delete the node_modules folder.
Then we run
npm install
to install all packages again.