david-driscoll / atom-yeoman

A yeoman ui for atom.io
https://github.com/david-driscoll/atom-yeoman
MIT License
26 stars 5 forks source link

Generators installed with `npm install -g` does not get pick up #7

Open blai opened 9 years ago

blai commented 9 years ago

⌘ + shift + P => yo => Generator window shows up with empty list (but I do have a couple of generators installed locally using npm install -g)

david-driscoll commented 9 years ago

Odd, do you happen to know what directory they're saved too?

Because atom is a different runtime environment than the real node... it's kinda hacking to find them.

Right now for linux it adds /usr/lib/node_modules/ which looking it now might just be terribly wrong. https://github.com/david-driscoll/atom-yeoman/blob/master/lib/generator.ts#L20

david-driscoll commented 9 years ago

And forgive my ignorance, I don't have a linux/mac machine at the moment. I'm going to setup a VM sometime soon.

david-driscoll commented 9 years ago

I just setup a plain Ubuntu VM and fired up atom with atom-yeoman installed. After installing a generator everything seems to be working. I am very curious to find out what the path for global modules.

nosami commented 9 years ago

/usr/local/lib/node_modules/generator-aspnet/ for me

david-driscoll commented 9 years ago

@nosami on Jabbr ran into this too... adding /usr/local/lib/node_modules/ to the paths to search. Hopefully that'll fix it for you.

blai commented 9 years ago

@david-driscoll Thanks for the quick response. I am exploring this project in hope that I can help down the line. I use nvm so my node_modules dir would be this /Users/brianlai/.nvm/v0.10.37/lib/node_modules.

david-driscoll commented 9 years ago

hrmm I'd have to know more about how .nvm works to get the right way to search for the files.

I added the extra path for @nosami so, and that seemed to work there. So it's probably just along the lines of detecting if nvm is in the home directory and finding the currently selected version.

https://github.com/david-driscoll/atom-yeoman/blob/master/lib/generator.ts#L24