brackets-gh
brackets-gh copied to clipboard
installing brackets-gh on Windows and node-gh dependencies
Hi! i'm trying to generate a GitHub token. It's not clear to me what terminal should i use.
i opened Brackets-node.exe from Brackets folder:
there i enter the command as shown on the picture with octocat:
it shows " ... "
what's next?
a better installation instruction would probably help. thanks!
Hi @angieskazka, sorry if the instructions are not that clear. I'll try to improve them based on what you found confusing.
Please, bear in mind that I'm not on a windows machine right now, so I'm just talking from the top off my head.
- On the instructions, it's assumed that you have
nodejs
installed in your machine. If that's not the case, you can download and install the appropriate version for you on http://nodejs.org/ - Once node is installed on your machine on windows, the terminal I was referring to is the "Command Prompt". As far as I remember, there are at least to ways of opening it:
- Press the keys
Win + R
, writecmd
on the prompt and hitEnter
. The terminal should appear. - Go to Start > Programs > Accesories > Command Prompt
- Press the keys
Then, after pasting the line, you should see a prompt asking for you github username and password.
Please, give it a try and let me know if something is still unclear so we can figure it out.
you're right, Node was not installed on my machine. I checked the instruction on github once again but i haven't found such a requirement there. So after installing node, I launched cmd, navigated to the folder where node.exe is, and pasted the command. Here is what i got now:
c:\Program Files (x86)\nodejs>node c:\Users\Angie\AppData\Roaming\Brackets\exten sions\user\bracketsgh\node\node_modules\gh\bin\gh.js us -1 module.js:356 Module._extensions[extension](this, filename); ^ Error: %1 is not a valid Win32 application. c:\Users\Angie\AppData\Roaming\Brackets\extensions\user\bracketsgh\node\node_mod ules\gh\node_modules\copy-paste\node_modules\execSync\build\Release\shell.node at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.(c:\Users\Angie\AppData\Roaming\Brackets\extensions\us er\bracketsgh\node\node_modules\gh\node_modules\copy-paste\node_modules\execSync \index.js:24:11) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (c:\Users\Angie\AppData\Roaming\Brackets\extensions\us er\bracketsgh\node\node_modules\gh\node_modules\copy-paste\index.js:1:78) c:\Program Files (x86)\nodejs>
[my OS is win7 x64]
Hi @angieskazka, the node information is not in the instructions. I'll make sure to clarify that.
As for the error... could you try the following?
- Launch
cmd
- Navigate to
c:\Users\Angie\AppData\Roaming\Brackets\extensions\user\bracketsgh\node\node_modules\gh\bin\
- Execute
node gh.js us -l
tried, but seems like the same thing comes out
c:\Users\Angie\AppData\Roaming\Brackets\extensions\user\bracketsgh\node\node_mod ules\gh\bin>node gh.js us -l module.js:356 Module._extensions[extension](this, filename); ^ Error: %1 is not a valid Win32 application. c:\Users\Angie\AppData\Roaming\Brackets\extensions\user\bracketsgh\node\node_mod ules\gh\node_modules\copy-paste\node_modules\execSync\build\Release\shell.node at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.(c:\Users\Angie\AppData\Roaming\Brackets\extensions\us er\bracketsgh\node\node_modules\gh\node_modules\copy-paste\node_modules\execSync \index.js:24:11) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (c:\Users\Angie\AppData\Roaming\Brackets\extensions\us er\bracketsgh\node\node_modules\gh\node_modules\copy-paste\index.js:1:78)
Oh :(
It looks like the copy-paste
module used inside the nodegh
library has some compatibility issues on windows...
I'll install a windows virtual machine later today and try to get to the bottom of this. I'll let you know as soon as I find anything. Sorry for the inconvenience :S
thanks! highly appreciate
2013/10/30 Chema Balsas [email protected]
Oh :(
It looks like the copy-paste module used inside the nodegh library has some compatibility issues on windows...
I'll install a windows virtual machine later today and try to get to the bottom of this. I'll let you know as soon as I find anything. Sorry for the inconvenience :S
— Reply to this email directly or view it on GitHubhttps://github.com/jbalsas/brackets-gh/issues/14#issuecomment-27373365 .
Tänk för att du läser meddelanden alltid från skarm, utan utskrivning
Hey @angieskazka,
I was looking into this the other day, and I'm sorry to say that for now it seems nodegh is currently not supported on windows due to some dependencies. I talked to @zenorocha and they plan to support it, but they don't have a defined path right now.
I'll update the installation instructions to reflect this and leave this issue open to notify you if anything changes.
Having the same error on windows 8. It appears to occur that the line where it is requiring shell.
if (!shell) {
shell = require('./build/Release/shell'); //this line
}
Hi @angieskazka, I managed to get it to work. It can be seen as more of a hack though until it is fixed for windows. First time playing with a node module to forgive any thing I may have missed.
As I stated in my earlier response, the error is thrown when it requires shell. The shell is used to exec the commands. Looking around I found one shelljs that is able to do the same thing and works in Windows. Now everything is working as expected. Below are the steps I followed
- Install shelljs in the gh folder
- Open the commandline and navigate to the bracketgh extension folder. Open the node folder. Mine was C:\Users\User\AppData\Roaming\Brackets\extensions\user\bracketsgh\node
- Install shelljs using
npm install shelljs
- With shelljs installed, update the execSync file to use it instead of its own shell. Because this is specifically for windows, I ended up removing all checks for windows to simplify the code.
- Open the execSync's index.js file. Path is \Brackets\extensions\user\bracketsgh\node\node_modules\gh\node_modules\copy-paste\node_modules\execSync\index.js
- Replace with the code below
/*============================================================================
* Copyright(c) 2010 Mario L Gutierrez <[email protected]>
* MIT Licensed
*==========================================================================*/
//@ritcoder: just a hack to use shelljs instead of the local shell. Assumes this is being run from windows.
var sh = require('shelljs');
/**
* Runs `cmd` synchronously returning the exit code.
*/
function run(cmd) {
try {
cmd = 'cmd /C ' + cmd;
return sh.exec(cmd).code;
} catch (err) {
if (err) {
console.error(err)
}
return 1;
}
}
/**
* Executes `command` synchronously capturing the output.
*
* This is a wrapper around `run` function.
*/
function exec(command) {
cmd = 'cmd /C '+cmd;
var output = sh.exec(cmd);
return {code:output.code,stdout:output.output};
}
module.exports = {
run: run,
exec: exec
};
- Lastly, execute the command for getting the token (the path is shortened since we are working from \bracketsgh\node) . It will say you are logged in as ...
node node_modules\gh\bin\gh.js us -l
Restart brackets and you'll see that the github menu will now have new items. I couldn't go further than that since the project was not on github but I can see changes in the ui.
I hope a solution is found to this by making execSync or copy-paste use shelljs which seems to work fine in windows.
Hi @ritcoder that's awesome, thanks for digging in!
I actually have a branch which, among other things, removes completely the dependency with the copy_paste module. I plan to test it on windows next monday to see if everything works as expected :)
You can check it out at https://github.com/jbalsas/brackets-gh/tree/module_pr
Hi @jbalsas, Just updated my version of GH with the new one. I tried the registration to see if I can get the error reported by @angieskazka but it said I was already logged in.
I opened a github projects and it worked just fine
- I could add new issues
- I could open the panel that should list all issues.
One thing though is that the first time I tried adding an issue, it just showed the busy signal and was there until I pressed escape. Tried listing all issues before the true error was shown. The log stated
{
code: 410
message: '{"message":"Issues are disabled for this repo","documentation_url":"http://developer.github.com/v3/issues/"}'
}
Apparently, it was not enabled and I could add issues when I enabled it. There appears to be no way to refresh the issue list in the bottom panel and it always says there are no issues even when I added the two issues (one open, one closed) as shown here.
Lastly, creating gists also worked fine (both normal and secret )
The copy paste module used on NodeGH were fixed on https://github.com/node-gh/gh/commit/f43f0eff59ec99ceae0044061d75f007fdc4d440#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R40. You may want to try it.
@eduardolundgren Looks great! I'll try it out tomorrow, thanks!
@ritcoder You can logout using the node gh.js us -L
command. I'll take a look to the error you mention, since it should be showing the message error... thanks a lot for testing it! ;)
I face this problem too. But I'm on Linux.
but when i follow @ritcoder it's working now. :+1:
Thanks,
3 months later, on a clean install of Brackets (non-Srint/Sprint 35) ... same issues described above. I will try to resolve based on comments. A bit disappointing.
On Windows 8.1 I solved the problem with:
C:\Users\User>npm install -g gh
https://github.com/node-gh/gh#user
C:\Users\User>gh user --login
Good luck.
Cool. I remember seeing someone post about doing a "forced" logout or something, makes sense... but, I also already ahead and did gh global install (inferred that I'd need to since I've got a pretty clean dev env there). I'll try it when I get home, thanks! ... while I did start fumbling around with Brackets in it's 20's but never became an ardent user over Sublime, I officially switched over last night. We'll see how the next few weeks work out.
Thanks for the feedback! Date: Mon, 20 Jan 2014 10:58:51 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [brackets-gh] installing brackets-gh on Windows and node-gh dependencies (#14)
On Windows 8.1
I solved the problem with:
C:\Users\User>npm install -g gh
https://github.com/node-gh/gh#user
C:\Users\User>gh user --login
Good luck.
— Reply to this email directly or view it on GitHub.
Hey @code4joe, I'm terribly sorry you stumbled onto this :disappointed:
If I remember correctly, I merged the new node-gh version into the https://github.com/jbalsas/brackets-gh/tree/module_pr branch, but never got the time to merge it back to master and push it to the registry.
I'm trying to get up to speed again with everything after some time away, so hopefully I should be able to update this issue with more information and push a fully functional version to the Brackets registry soon.
Sorry for the inconvenience and thanks for trying it out!
@alexsalas Thanks for the comment! I'll try to fix this and test it on a windows machine asap!
@sophearak I'll venture things should also work on Linux with the new update, but I'll check it out as well
Yeah -- that's exactly what I figured -- I saw the code commits but no merges to master, lol! And, I was too tired at that point to do anything as tedious as cherry-picking code! Glad I got this to you so you were able to fix it.... there will eventually be a lot of Windows users.
Date: Mon, 20 Jan 2014 15:33:54 -0800 From: [email protected] To: [email protected] CC: [email protected] Subject: Re: [brackets-gh] installing brackets-gh on Windows and node-gh dependencies (#14)
Hey @code4joe, I'm terribly sorry you stumbled onto this
If I remember correctly, I merged the new node-gh version into the https://github.com/jbalsas/brackets-gh/tree/module_pr branch, but never got the time to merge it back to master and push it to the registry.
I'm trying to get up to speed again with everything after some time away, so hopefully I should be able to update this issue with more information and push a fully functional version to the Brackets registry soon.
Sorry for the inconvenience and thanks for trying it out!
@alexsalas Thanks for the comment! I'll try to fix this and test it on a windows machine asap!
@sophearak I'll venture things should also work on Linux with the new update, but I'll check it out as well
— Reply to this email directly or view it on GitHub.
Still had the same issue today. Follow rit's advice for success. Also, there is a spelling error in the string the error message displays next to the github icon. It should be 'node_modules' and not 'node_modues' Thank you for posting!!
@jbalsas how do you exactly install this on mac? I'm typing this:
node /Users/carlossantiago1/Library/ApplicationSupport/Adobe/Edge Code CC/extensions/user/bracketsgh/node/node_modules/gh/bin/gh.js us -l
and I'm getting this:
module.js:340 throw err; ^ Error: Cannot find module '/Users/carlossantiago1/Library/Application' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3
do I have to put %20 in between spaces? I did but still says that it can't find directory. heres a screenshot of the path because its there.
*correction:
node /Users/carlossantiago1/Library/Application Support/Adobe/Edge Code CC/extensions/user/bracketsgh/node/node_modules/gh/bin/gh.js us -l
Every time i push 'Explore issues' i got the same error 'Could not find proper githud repo setup'. What does it means?
ritcoder that worked great!
@eduardolundgren ftw on Ubuntu 10.04
On Windows 7
Thanks @alexsalas. This fixed it for me. https://github.com/jbalsas/brackets-gh/issues/14#issuecomment-32786889
But I need to add node
to the command line while in CMD. Git Bash worked fine without it.
$ node gh user -l
There is still not a clean install for Windows (Brackets 1.3). Installing via the Extension Mgr still emits the same errors described by @angieskazka https://github.com/jbalsas/brackets-gh/issues/14#issuecomment-27373147 Had to apply the hack described by @ritcoder https://github.com/jbalsas/brackets-gh/issues/14#issuecomment-27623329