Cannot find module '.' from 'node_modules/bs-logger/dist/logger/root.js'
LudoPL opened this issue · comments
Hi !
I have an issue I had not been able not able to understand.
Your module are implicated in it but it doesn't mean it is caused by it.
Here is what I know.
In my gitlab pipeline, when jest is executed to run some unit tests, I have the following error :
● Test suite failed to run
Cannot find module '.' from 'node_modules/bs-logger/dist/logger/root.js'
Require stack:
node_modules/bs-logger/dist/logger/root.js
node_modules/bs-logger/dist/index.js
node_modules/ts-jest/dist/utils/logger.js
node_modules/ts-jest/dist/presets/create-jest-preset.js
node_modules/ts-jest/utils/index.js
src/functions/other/version/handler.spec.ts
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
at Object.<anonymous> (node_modules/bs-logger/dist/logger/root.js:35:10)
What is strange is that I don't have this error when I run the command locally, nor when I run the command manually inside a docker container based on the same docker image my gitlab ci pipeline is using.
It seems the only reference to your module is through jest, I don't use your module directly and it doesn't seem to be used by my other external dependencies (according to npm ll
)
I guess my description will not be enough to help, but I share it anyway in case someone encounter it too.
Thanks anyway for contributing to the open-source world.
Regards
I don't know how it is possible (that means I have probably miss something) but I have fix the issue by re-building the docker image used by the pipeline from a centos machine (same OS than our gitlab runner docker host) instead of my fedora machine.
And the problem has disappeared, so it seems it was linked somehow with the npm/node installation (even if our docker file fix the node version and install it through nvm).