soprasteria / sonar-report

Generates an html report from SonarQube
GNU General Public License v3.0
87 stars 43 forks source link

potential dependency breaking usage #255

Open christosservosNCIN opened 7 months ago

christosservosNCIN commented 7 months ago

Hello,

it looks like after every new installation of the tool (e.g. with npm install -g sonar-report), i receive the following error when trying to run it:

$ sonar-report -h node:internal/errors:496 ErrorCaptureStackTrace(err); ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/usr/local/lib/node_modules/sonar-report/node_modules/properties-file/lib/esm/properties' imported from /usr/local/lib/node_modules/sonar-report/node_modules/properties-file/lib/esm/index.js at new NodeError (node:internal/errors:405:5) at finalizeResolution (node:internal/modules/esm/resolve:327:11) at moduleResolve (node:internal/modules/esm/resolve:980:10) at defaultResolve (node:internal/modules/esm/resolve:1193:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:403:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:372:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38) at ModuleWrap. (node:internal/modules/esm/module_job:76:39) at link (node:internal/modules/esm/module_job:75:36) { url: 'file:///usr/local/lib/node_modules/sonar-report/node_modules/properties-file/lib/esm/properties', code: 'ERR_MODULE_NOT_FOUND' }

Node.js v18.19.1

It looks like a recent update (today) on one of the dependencies ('properties-file' -- see https://www.npmjs.com/package/properties-file/v/3.4.0) might be breaking usage of sonar-report)

Has anyone else encountered this? Is it a wider issue or i have messed something up?

KarthikHolikatti commented 7 months ago

Yes, facing the same issue. But even when i install sonar-report version 3.1.2

aiyaruch1320 commented 7 months ago

i tried version 3.0.10, it's worked.

KarthikHolikatti commented 7 months ago

@aiyaruch1320 thanks, that works for me too. Guess the latest release needs to be reverted or we have to wait till the changes are made and there is a new version!

thecampagnards commented 7 months ago

Sorry for the inconveniences, I will fix it and release a new version on Monday Or if someone does a pr I will be able to merge and release Thx

thecampagnards commented 6 months ago

I tried to use the latest release like this:

docker run --rm -ti node:18 bash -c 'npm install -g sonar-report && sonar-report -h'

And it works well, can you tell me more about your install etc ? I'm going to push dep update hope it will fix your issue