one more thing you can try, replace node.exe in frontend folder with exact version node.exe that you download from online. Sometimes the one which gets downloaded from code base might not work as expected. Then delete node_modules inside and outside and execute a maven build
I too got same error, I was able to resolve by deleting node_modules folder and running the build again, looks like the folder that I got from GIT not compatible with my machine. Useful to run this npm command too "npm cache clean --force"