I had this problem and it turned out, I had a symbolic link inside node_modules
pointing to it's parent, i.e.
[user@localhost]$ ls -la /path/to/project/node_modules
total 3272
...
lrwxrwxrwx 1 user user 50 Nov 26 18:38 node_modules -> ../node_modules
...
I mean, somehow I messed the bash script and it created a circular symbolic link. Removing the symbolic link solved the issue.