Most likely you have this issue due to the package-lock.json. Somehow it seems to block you from recompiling or rebuilding your dependencies, even if you explicitly run npm rebuild
. I ran all the following to fix it for me:
rm package-lock.json;
rm -rf node_modules;
npm install;