Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

generator-angular - You don't seem to have generator with the name angular installed

So I wanted to take a look at the latest generator, seeing as they use gulp now.

Anyhow, after updating everything twice, reinstalling node, deleting npm-cache and so on, when I do yo angular the following happens:

  • The generator starts and asks me the usual questions (grunt/gulp, sass? etc)
  • I can choose the angular modules I want (ng-animate, etc.)
  • It begins to generate the app skeleton

Then it crashes (before running npm install / bower install apparently), with the not very helpful message

Error angular

You don't seem to have a generator with the name angular:common:C:\Users\myuser\AppData\Roaming\npm\node_modules\generator-angular\app\index.js installed.

The directory is there (generator-angular). The sub-directory is there (generator-angular/common). The index.js exists. I have installed and updated the generator and all the dependencies like 5 times now.

Now, the strange thing is, I tried older versions of yo and also generator-angular and they all fail with the same error message, so it's very likely something on my end, but I can't figure it out.

I've found older threads of this issue here on StackOverflow but all were solved by updating or fixing the path. None of that helped me :(

Here is the yo doctor output

Yeoman Doctor
Running sanity checks on your system

√ Global configuration file is valid
√ Node.js version
√ No .bowerrc file in home directory
√ No .yo-rc.json file in home directory
√ npm version
√ NODE_PATH matches the npm root

Everything looks all right!

Also I'm on Win10x64. Any ideas?

like image 728
Khufu Avatar asked Dec 27 '15 12:12

Khufu


People also ask

What is a good example of a code generator in AngularJS?

A good example for this is Nrwl’s Nx which allows to generated boilerplate code for Ngrx or upgrading an existing application from AngularJS 1.x to Angular. These code generators are called Schematics and can not only create new files but also modify existing ones.

How do I add a new component to an existing ngmodule?

The new component is the entry component of the declaring NgModule. The declaring NgModule exports this component. Create the new files at the top level of the current project. Include styles inline in the component.ts file. Only CSS styles can be included inline.

What is angular CLI schematics?

This blog post is part of an article series. Update, 2018-05-08: Updated for newest CLI version. Since some versions, the Angular CLI uses a library called Schematics to scaffold building blocks like components or services. One of the best things about this is that Schematics allows to create own code generators too.

Should I use a generator to create my website?

Before creating a generator it is a good idea to have an existing solution that contains the code you want to generate in all variations. In addition to that, the template for this component is just a bunch of html tags with the right Bootstrap based classes — something I cannot learn by heart what’s the reason a generator seems to be a good idea:


1 Answers

Fixed by @SBoudrias in version 0.15.1. Can you try npm uninstall -g yo && npm install -g yo ?

like image 62
Manasov Daniel Avatar answered Oct 13 '22 16:10

Manasov Daniel