node-sonar-scanner
node-sonar-scanner copied to clipboard
'node_modules' is not recognized as an internal or external command
Might be very basic issue, I just followed the readMe,
- Installed the sonar-scanner.
- Put the npm script.
- run the script.
got the error, 'node_modules' is not recognized as an internal or external command, operable program or batch file.
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.
try a ./
in front of the node_modules
.
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
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
Try to add "node ./" in front of node_modules
put in script just.
"sonar": "sonar-scanner"
and then run:
npm run sonar
put in script just.
"sonar": "sonar-scanner"
and then run:
npm run sonar
works for me. thanks !
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!