node-sonar-scanner icon indicating copy to clipboard operation
node-sonar-scanner copied to clipboard

'node_modules' is not recognized as an internal or external command

Open merqrial opened this issue 6 years ago • 8 comments

Might be very basic issue, I just followed the readMe,

  1. Installed the sonar-scanner.
  2. Put the npm script.
  3. run the script.

got the error, 'node_modules' is not recognized as an internal or external command, operable program or batch file.

merqrial avatar Feb 06 '19 09:02 merqrial

Same here. I also tried different option such as changing the path or using .bat file or by just keeping the "sonar-scanner" instead of whole path. And keep getting, 'node_modules' is not recognized as an internal or external command, operable program or batch file.

vipulpanchal avatar Feb 08 '19 14:02 vipulpanchal

try a ./ in front of the node_modules.

fizal619 avatar Apr 15 '19 19:04 fizal619

i did try with : "sonar-scanner": "./node_modules/sonar-scanner/bin/sonar-scanner.bat", but this throw an error: '.' is not recognized as an internal or external command,

I tried with: "sonar-scanner": "sonar-scanner/bin/sonar-scanner" and this worked to run sonarqube scanner but execution fails because i haven't set sonarqube server

AshuSingh07 avatar Feb 21 '20 16:02 AshuSingh07

I tried with: "sonar-scanner": "sonar-scanner/bin/sonar-scanner" but I got the following error please help me out in this...

sonar-scanner/bin/sonar-scanner

events.js:174 throw er; // Unhandled 'error' event ^

Error: spawn cmd.exe ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:757:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) Emitted 'error' event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12) at onErrorNT (internal/child_process.js:415:16) [... lines matching original stack trace ...] at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] sonar-scanner: sonar-scanner/bin/sonar-scanner npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] sonar-scanner script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\dell\AppData\Roaming\npm-cache_logs\2020-03-05T11_08_40_490Z-debug.log

srirang-subhedar avatar Mar 05 '20 11:03 srirang-subhedar

Try to add "node ./" in front of node_modules

CarlosCastroTrejo avatar Aug 11 '20 22:08 CarlosCastroTrejo

put in script just.

"sonar": "sonar-scanner"

and then run:

npm run sonar

Black-Jack-1978 avatar Oct 28 '21 11:10 Black-Jack-1978

put in script just.

"sonar": "sonar-scanner"

and then run:

npm run sonar

works for me. thanks !

rukmanidevi-bh avatar Mar 09 '22 12:03 rukmanidevi-bh

put in script just.

"sonar": "sonar-scanner"

and then run:

npm run sonar

I was having the same issue with using Cucumber and I changed from node ./node_modules/.bin/cucumber-js to just cucumber-js and it worked!

rayzistdev avatar Aug 15 '22 18:08 rayzistdev