brackets-userland / brackets-npm-registry

Extension to install other extensions with npm
MIT License
44 stars 8 forks source link

broken on Windows #4

Closed zaggino closed 9 years ago

zaggino commented 9 years ago

I currently don't have an access to Windows PC but the extension is obviously broken. Will need to investigate. PR's are welcome too.

mackenza commented 9 years ago

Will have a look today and see if I can help on Windows

zaggino commented 9 years ago

Thanks @mackenza, I'll be glad for any help I can get. My Windows machine won't be usable until next week or so.

mackenza commented 9 years ago

I don't get any errors in console after you fixed #3 All I get is the following:

 [brackets-npm-registry] installing brackets-eslint into C:/Users/andrew.mackenzie/AppData/Roaming/Brackets/extensions/user
Logger.js:46 [brackets-npm-registry] brackets-eslint failed to install:
 undefined : undefined

I have not resorted to stepping through the code yet.

mackenza commented 9 years ago

I can't really figure out why the install fails. I stepped through it and I got quite lost in the promise code and the node domain stuff.

zaggino commented 9 years ago

@mackenza I've fixed a lot of error logging in 0.1.3, might be useful to check again in case you have time to spare.

equinox commented 9 years ago

Windows 7 here, I just tried and got this error when clicking all the options. They all gave the same error.

mackenza commented 9 years ago

It still doesn't install. I get the following using 0.1.4:

[brackets-npm-registry] installing brackets-eslint into C:/Users/andrew.mackenzie/AppData/Roaming/Brackets/extensions/user
/C:/Users/andrew.mackenzie/AppData/Roaming/Brackets/extensions/user/brackets-npm-registry/dist/utils/logger.js:46 [brackets-npm-registry] brackets-eslint failed to install:
 ERROR: {"cause":{"errno":50,"code":"EPERM","path":"C:\\Program Files (x86)\\Brackets\\node.exe"},"isOperational":true,"errno":50,"code":"EPERM","path":"C:\\Program Files (x86)\\Brackets\\node.exe"}

Node.exe referenced in the message is indeed located properly. This is the Node.exe that ships with Brackets. I also have node/npm installed separately on this machine as well.

I get no errors in the console, only the log message above.

edit: As I was typing this @Equinoxdawg entered his info which is consistent with what I am seeing.

zaggino commented 9 years ago

Thanks guys, moving further with this. Another fix landed in github master, version 0.1.5

equinox commented 9 years ago

Still the same error for me on all options.

zaggino commented 9 years ago

Do you have node.js installed and available in system path?

equinox commented 9 years ago

Yeah.

zaggino commented 9 years ago

While Mac and Linux will work without node.js, because we can symlink to node included in Brackets, this cannot be done on Windows as it dont allow non-administrators to create symlinks. You could try running Brackets as an administrator but that's not the long term solution.

zaggino commented 9 years ago

That's strange... Node is installed in default program files?

equinox commented 9 years ago

New error when running Brackets as admin.

zaggino commented 9 years ago

@Equinoxdawg you have to reinstall the extension from github and run npm install in its directory. This is fixed in latest, win platform should have .exe behind the node: https://github.com/zaggino/brackets-npm-registry/blob/master/src/node/node-ensure.js#L25

equinox commented 9 years ago

I just downloaded as zip etc and npm install'd in there, still getting an error. Tried Brackets as admin and not.

zaggino commented 9 years ago

Did you download the 0.1.5 from here? https://github.com/zaggino/brackets-npm-registry/tags

equinox commented 9 years ago

First time was master branch, I believe. I just tried that specific release and still the same error.

zaggino commented 9 years ago

No idea why that's happening. I'll take a look as soon as provider fixes my home internet (In Australia it's common that when you move, you're offline for about 2-3 weeks :angry:)

equinox commented 9 years ago

If you ever need me to try something else or do something different, just say.

It's basically the same here in NZ. ;)

mackenza commented 9 years ago

I will look some more when I am in the office tomorrow.

2-3 weeks without Internet? I would cry On Mar 25, 2015 7:36 PM, "Equinoxdawg" notifications@github.com wrote:

If you ever need me to try something else or do something different, just say.

It's basically the same here in NZ. ;)

— Reply to this email directly or view it on GitHub https://github.com/zaggino/brackets-npm-registry/issues/4#issuecomment-86253484 .

mackenza commented 9 years ago

I am afraid your code is more complex than I am used to with all the promises everywhere and tons of .then stuff.

I realize you probably cannot work on this properly until you get your Windows machine going but I would suggest that instead of trying to symlink node.exe that you simply use the one in the Brackets folder... c:\Program Files(x86)\Brackets\node.exe. Either that or assume that node is installed and on the user's PATH and therefore just call it with node.exe? Is that being too naive?

zaggino commented 9 years ago

Ah, nevermind. I actually use the node.exe installed in the path, when found. I cannot use node.exe in Brackets, because it's named Brackets-node.exe and not node.exe. I've tried solving that with symlink, but you can't create symlinks unless you're admin on Windows so this works only for Mac and Linux users. For Windows, the trouble will be probably somewhere near paths escaping or something like that. Good thing is, my internet got connected last evening so I should be able to look at this soon and get the Windows going.

mackenza commented 9 years ago

On Windows, it's named node.exe. They changed that a while back. Don't know if that helps, but I just confirmed it to be the case.

zaggino commented 9 years ago

Oh, that will definitely help for people who don't have node installed. Good news :)

zaggino commented 9 years ago

The name's a funny thing, but npm and following gulp grunt or different install tasks are not able to execute unless there's a node.exe somewhere available. I use gulp to compile ES6 into ES5 for Brackets.

mackenza commented 9 years ago

Honestly, I would prefer to see this go another way. It might not affect the need to run node/npm so the problem may still exist but I would like to see this:

  1. The Brackets Registry still downloads a zip file of the extension. I know it's had some issues lately but maybe instead of replacing it altogether, we could fix what's wrong with it and maybe move it to a host we have more control of rather than AboutWeb?
  2. The package.json could contain further dependencies which require npm to run to satisfy. This would be an optional subtask of the extension manager install function.

I think this would make it less complicated.

zaggino commented 9 years ago

I've already done PR for downloading npm dependencies https://github.com/adobe/brackets/pull/10602. This project is not about that and I'm not asking anyone to replace default extension registry with this.

This project is about distributing extensions which require a bit more. I'm planning to work on a new version of Brackets-Git which will be written in ES6 and probably depend on some native code which will need to be compiled on install. To distribute that, I need all the power of npm I can get. That's the reason I've created this project.

mackenza commented 9 years ago

fair enough. I really wish they would merge 10602. It covers a lot of use cases and makes the existing registry much better.

I will help as much as I can with this too.

zaggino commented 9 years ago

Finally got to my Windows machine, I've found the cause, currently blocked by https://github.com/IndigoUnited/node-cross-spawn/issues/9

zaggino commented 9 years ago

0.1.6 is out and works on my windows, can you please test too @mackenza @Equinoxdawg ?

equinox commented 9 years ago

I was able to successfully update Brackets Git and Brackets ESlint, no errors or anything. Great work! :D

zaggino commented 9 years ago

cat

mackenza commented 9 years ago

same here, updated git and installed eslint without errors. I do have to reload Brackets to take effect but the process seems to work now.

Good job!

zaggino commented 9 years ago

Thanks guys. Yes I know about the UX issues but I'm happy he installation works on all three platforms. Working on the rest should be much easier.