I have an angular project which has a git submodule for the backend.
It builds fine when i run it on my local machine. But, when i build it on travis it fails.
npm ERR! enoent ENOENT: no such file or directory, open '/home/travis/build/faxad/cartify/backend/node_modules/raw-body/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
Complete build log here.
https://travis-ci.org/faxad/cartify/builds/378869452
After taking a close look at travis logs, i found out that travis issues the following commands (which also throws the same error when i run them locally)
git clone --branch=upgrade https://github.com/faxad/cartify.git faxad/cartify
git submodule update --init --recursive
However, the following seems to be working fine without any issues
git clone --recursive https://github.com/faxad/cartify.git
I did manage to resolve the issue by first installing the dependencies of the submodule project and then for the project itself.