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:
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?
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.
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.
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.
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:
Fixed by @SBoudrias in version 0.15.1. Can you try npm uninstall -g yo && npm install -g yo
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With