Closed pulkitsinghal closed 9 years ago
Thanks for reporting the issue, will check what might be the problem here.
Can't reproduce, I would appreciate if you submitted a PR. Tip: the error's root must be in Program#setupCommands (lib/program.js, line 80).
I'll do my best to provide a PR but what if I gave you access to a windows VM in the Azure cloud, that has this problem exactly reproduced? Would you consider having a peek there if I fail to fix the prob on my side?
I don't think it should be that hard. Just put console.log's in a few places inside setupCommands(), so that you see how the error comes up. It's because of a wrong path, that's being constructed in setupCommands() method.
Ok figured out the problem ... although I would be very interested in trying to find out what is different in our windows machines (i'm on windows7 and node v0.10.33) ... since you couldn't reproduce.
Moving the convo to gitter.
so line 86 is the culprit i suppose:
path = path.replace(join(_this.path, "commands"), "").replace(separator, "");
@vdemedes - the substitution fails because _this.path
is C:\blah\blah\
whereas the path
is c:/blah/blah/
so the match does not happen because of forward/back slash mismatch?
Well, this should not happen, because I'm using Node's path.join()
everywhere. Weird.
Similar issue here joyent/node#2309. But it was 4 years ago, so shouldn't be a problem now. What does __dirname
in your entry script return?
Found a reason - https://www.npmjs.com/package/glob#windows
@vdemedes instead of path.replace("/", separator) please use: path.replace(/\//g, separator) as that is what worked when I tested on windows7 ... I left a comment inline w/ your ealier commit: https://github.com/vdemedes/ronin/commit/c12378771f383bd393c037deec0404adbc5fb72d#diff-f58bf85b407228fb1ceb45c5f8748e6cR102
Such a stupid mistake. Fix coming, thank you.
@vdemedes - its baaaaack!
It works on one windows7 machine but on another, I see this output:
C:\>vend-tools
[ 'c:/dev/.nvmw/v0.10.36/node_modules/vend-tools/commands/configure.js',
...
'c:/dev/.nvmw/v0.10.36/node_modules/vend-tools/commands/report-costs-for-suppliers.js' ]
c:/dev/.nvmw/v0.10.36/node_modules/vend-tools/commands/configure.js
C:dev\.nvmw\v0.10.36\node_modules\vend-tools\commands\configure.js
...
error Cannot find module 'c:\dev\.nvmw\v0.10.36\node_modules\vend-tools\commands\C:dev\.nvmw\v0.10.36\node_modules\vend-tools\commands\configure.js'
cc @elbrando
Updated a ronin based project from
"ronin": "0.1.2"
to"ronin": "0.3.5"
and ran npm installBut afterwards I realized that something is wrong with the command path resolver because I keep running into errors like:
This doesn't happen on mac.