-
Notifications
You must be signed in to change notification settings - Fork 217
Doesn't work on Windows #392
Comments
Hi @codefoster, can you please tell the command you're trying to invoke and doesn't work (or doesn't it work at all?), the complete exception error, and both your gh and node versions?
Thanks. |
I tried a few different commands and they do the same thing. The last one I tried was node --version //I use nodist (like nvm) and tried 10.33,12.2,and 12.4
gh --version //can't tell... it throws the same error |
Okay, please try the following:
If it still doesn't work, please copy & paste the entire stack trace in this issue. |
Sorry for the delay. Didn't work. Here's the full trace...
|
@codefoster, I have been pretty busy. Here are the things that I know might solve or mitigate your issue: |
On windows 8.1, has the same stdout.toString() nodejs v0.12.7, the last gh. |
Hey @henvic, @zenorocha, This is an issue with libuv, it doesn't search for *.bat or *.cmd files. I've debugged it and found that child_process.spawnSync() fails with ENOENT on Windows OS. Please see the same issue here: nodejs/node-v0.x-archive#25330 As a temporary workaround I've modified the gh/lib/exec.js # spawnSync with the code below: exports.spawnSync = function(cmd, args, options) {
var exec;
logger.debug('spawnSync: ' + cmd + ' ' + args.join(' '));
if (cmd !== 'git') {
exec = child_process.spawnSync(cmd + '.cmd', args, options);
}
else {
exec = child_process.spawnSync(cmd, args, options);
}
return {
stdout: exec.stdout.toString().trim(),
stderr: exec.stderr.toString().trim(),
status: exec.status
};
};
Hope that helps for Win users. :) Related to: #349 |
Thanks @ZoltanTakacs - I created a pull request based on your hack, while adding a check for if the users is running on Windows #411 |
@Nilzor, @ZoltanTakacs et al., PS: if you stop using Windows I'll buy you a 🍺 😆 |
Works fine! I'll take that beer anyway ;) 🍺 |
I get an error in gh/lib/exec.js:24 at...
Stating that it
Cannot read property 'toString' of null
The text was updated successfully, but these errors were encountered: