Closed andife closed 6 years ago
I'm not running code-forensics on windows so I can't actually reproduce this problem, however I think the issue could be that webserver.js is expecting the OS to figure out how to execute itself as a script (through the shebang #!/usr/bin/env node) and this is not much Microsoft friendly.
Have you tried and run the webserver.js script directly with node?, i.e.:
cd C:\Users\user1\node_modules\code-forensics\scripts
node webserver.js
If that works then the issue is likely to be what I mentioned, and for the moment you could make yourself a simple .bat script to run the server in place of using gulp.
One idea is to try and use the npm package "bin" configuration Have a read at http://stackoverflow.com/questions/10396305/npm-package-bin-script-for-windows
My suggestion is to: a) rename scripts/webserver.js to scripts/webserver b) create a mapping in package json to link the command, i.e.
"bin": {
"cf-webserver": "./scripts/webserver"
},
c) don't forget to update the gulp task to refer to the renamed script (the js file is lib/tasks/misc_tasks.js)
I used "cf-webserver" because "webserver" may be a bit too generic and clash with other modules.
In theory, when you install code-forensics in Windows, NPM should create a cmd wrapper around the script which would allow you to execute it properly
I am using code-forensics on Windows 10 through Docker.
The docker image is built with the required Java, Node and I added git and subversion for convenience of pulling repos for analysis. In the image, gulp is installed globally and code-forensics under the root user. As the install happens on a fresh install, there's no collision between npm packages.
Here's the gist to the Dockerfile as well as a small batch file.
I use the batch in 2 ways. First to shell into the image and use e.g. git to clone with bash
as argument.
The other way is to invoke it inside a directory where I find the cloned repo (through shared volume) and the gulpfile.js I can edit with e.g. Sublime. It can be called without arguments to see the list of gulp tasks or like so e.g. cofo webserver
@jdevoo - the link to your gist (Dockerfile) above is broken, it should be:
https://gist.github.com/jdevoo/ebaf48afbd533748301cdcb0cbd34219
fixed - thank you @gernotstarke
@smontanari, just in case, I can confirm that node webserver.js
from node_modules\code-forensics\scripts
works in Windows.
And thanks for this wonderful tool ^_^
thank you @FlasH-RUS, I'm closing the issue then.
Hello, I installed code-forensics and tried to visualize the results now. Unfortunatly, I'm not able to start the webserver and I got the following error message.
Maybe it would be possible to give me hint, what I've done wrong and how I can help myself?