Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate directives/controllers etc does not seem to work #1

Closed
Mousaka opened this issue Feb 24, 2016 · 7 comments
Closed

Generate directives/controllers etc does not seem to work #1

Mousaka opened this issue Feb 24, 2016 · 7 comments

Comments

@Mousaka
Copy link

Mousaka commented Feb 24, 2016

Hi,
First of all, this was the first yeoman generator with angularjs and requirejs that I was able generate a project without getting any errors or needed to fix something in order to get it running (I've tried 3 different ones). So good job on that!
However, I'm having another issue:
I have successfully generated a project with:

yo angular-require-fullstack

But I don't seem to be able to generate directives/controllers/etc:

yo angular-require-fullstack:directive myDirective
Error angular-require-fullstack:directive myDirective 

You don't seem to have a generator with the name angular-require-fullstack:directive installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 30 registered generators run yo with the `--help` option.

So it seems like yeoman knows what "yo angular-require-fullstack" is but not what "yo angular-require-fullstack:directive" is for some reason.
Any ideas why?

Cheers

@escudero89
Copy link

Hi Mousaka,

Thanks for using our generator! And for making the effort of reporting the issue. I'll try to help you as far as I can.

Let's see, I've just created a new folder, testRequire, in which I executed just yo and chose from the list angular-require-fullstack. The generator made the right scaffolding, and now I've a new project named testRequire (after waiting for npm & bower install that takes eons).

Standing on the root of the folder, let's run the command and see what happen (I made a mistake in the spelling, but stay with me):

https://asciinema.org/a/89vlt3ed0tgvtty8alrodv35x

I didn't have that problem. So, let's make some checks:

  1. Do you have the latest version available of the generator installed? (v0.2.1) You can run yo and then update our generator.
  2. Are you standing in the right folder?

If those are not your problems, which still persists, let's go step by step together so we can solve your issue.

Greetings.

@Mousaka
Copy link
Author

Mousaka commented Feb 24, 2016

Thanks for answering so quickly!

  1. I have v0.2.1
  2. I'm standing in the same folder as where I ran yo angular-require-fullstack which I assume is the right one. Before generation it was empty.

Here is a paste of my log of me doing all the steps from upgrading angular-require-fullstack and generating project to trying to use yo angular-require-fullstack:directive:
https://gist.github.com/Mousaka/e626c0264c9f4b79ffff

@escudero89
Copy link

Okay some out of the top of my head ideas (I'll keep looking for a solution though):

  1. Did you run yo doctor? Perhaps there's something nasty going on. Especially if you've installed lots of other generators.
  2. What about making sure you have the latest yeoman version installed.
  3. And try installing once again our generator, and removing your unused generators. Something like running:
npm remove -g yo generator-* yeoman-generator 
npm install -g yo generator-require-fullstack

(look really well the first command before executing it, it will remove yo, the yeoman-generator all ALL yours npm apps that start with a generator prefix, you should check it before hitting enter)

I'll keep on touch.

@Mousaka
Copy link
Author

Mousaka commented Feb 24, 2016

  1. yo doctor sais everything is fine.
  2. I have the latest yo 1.6.0
  3. Tried this, uninstalled everything and then only installed yo and generator-angular-require-fullstack, same result unfortunately.

Seems to be something really weird going on.

Afterwards tried installing generator-angular to see if I could use its component-generator yo angular:route myRoute and that one worked.

UPDATE:
I also noticed using the command yo --generators will show angular-require-fullstack but not any of the sub-generators like angular-require-fullstack:directive ->

krlu@workbot:~/temps/te$ yo --generators
Available Generators:

  angular
    common
    constant
    controller
    decorator
    directive
    factory
    filter
    main
    provider
    route
    service
    value
    view
  angular-require-fullstack

UPDATE2:
I had my co-worker try this out as well on his computer. He also could not use or see the sub-generators.

@escudero89
Copy link

Mousaka, thanks for all the feedback. Really useful.

I was using npm link all this time to test locally the project (from the cloned repository). But thanks to your issue I started to think there was something fishy going on, so I moved to Cloud9 for testing, and just then I could replicated your problem.

I think I've nailed a solution (though it was quite lame tbh), and I encourage you to update your generator and try once again (if you're still working with it).

BUT when I said update, I mean, removing your old generator-angular-require-fullstack and installing it once again.

I'll be waiting for your feedback.

Cheers.

@Mousaka
Copy link
Author

Mousaka commented Feb 25, 2016

I can confirm that it works for me now! ✅
Well done!

btw, I realised this structure is not what I was after so I have moved on. The reason is because I'm not really doing a web-app. Doing something more like a angular-directive-repo just containing small individual directives/modules that my real web-app can use with depenencies (a bit like https://github.com/angular-ui). Now I'm not using any generators and it's going quite well.

@escudero89
Copy link

Glad that you found out what works best for you.

Anyways, thanks for your feedback, and good luck with your web-app!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants