angular-fullstack / generator-angular-fullstack

Yeoman generator for an Angular app with an Express server
https://awk34.gitbook.io/generator-angular-fullstack
6.12k stars 1.24k forks source link

factory generator #2381

Closed joshuacox closed 7 years ago

joshuacox commented 7 years ago
Item Version
generator-angular-fullstack 4.1.0
Node 6.9.1
npm 3.10.8
Operating System Arch linux
etc etc
Item Answer
Transpiler Babel
Markup Pug
CSS SCSS
Router ui-router
Client Tests Mocha
DB MongoDB
Auth Y
etc etc

When I make a new project yo angular-fullstack factorytest, and then try to make a factory it fails:

yo angular-fullstack:factory products
(!) require('yeoman-generator').generators.Base is deprecated. Use require('yeoman-generator').Base directly
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Cannot find module 'generator-ng-component/factory'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.resolve (internal/module.js:27:19)
    at child.compose (/usr/lib/node_modules/generator-angular-fullstack/generators/factory/index.js:7:94)
    at Object.<anonymous> (/usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:439:23)
    at /usr/lib/node_modules/generator-angular-fullstack/node_modules/run-async/index.js:25:25
    at /usr/lib/node_modules/generator-angular-fullstack/node_modules/run-async/index.js:24:19
    at /usr/lib/node_modules/generator-angular-fullstack/node_modules/yeoman-generator/lib/base.js:440:9
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)
$ npm list -g generator-angular-fullstack --depth=1
/home/user/.nvm/versions/node/v6.9.1/lib
`-- generator-angular-fullstack@4.1.0

all other generators work fine:

$yo angular-fullstack:route products
? What module name would you like to use? factorytestApp.products
? Where would you like to create this route? client/app/
? What will the url of your route be? /products
   create client/app/products/products.routes.js
   create client/app/products/products.component.js
   create client/app/products/products.component.spec.js
   create client/app/products/products.pug
   create client/app/products/products.scss
$yo angular-fullstack:service products
In the parent of this component, you should now import this component and add it as a dependency:

    import ProductsComponent from './products/products.component';
    ...
    export angular.module('myParentModule', [ProductsComponent]);
? What module name would you like to use? factorytestApp.products
? Where would you like to create this service? client/app/
   create client/app/products/products.service.js
   create client/app/products/products.service.spec.js
$yo angular-fullstack:controller products
? What module name would you like to use? factorytestApp.products
? Where would you like to create this controller? client/app/
   create client/app/products/products.controller.js
   create client/app/products/products.controller.spec.js
Awk34 commented 7 years ago

Hmm. List it out with a depth of 2. The latest version of the subgenerator is 1.0.5. Make sure you have that. If so, I'll have to investigate further.... Thanks for the report.

Awk34 commented 7 years ago

Actually, I just checked. This is a confirmed bug.

joshuacox commented 7 years ago

depth=2 did not reveal more on generator-angular-fullstack

$ npm list -g generator-angular-fullstack --depth=2
~/.nvm/versions/node/v6.9.1/lib
`-- generator-angular-fullstack@4.1.0

and by subgenerator did you mean ng-component?

$ npm list -g generator-ng-component --depth=2
~/.nvm/versions/node/v6.9.1/lib
+-- generator-angular-fullstack@4.1.0
| `-- generator-ng-component@1.0.5
`-- generator-ng-component@1.0.5

let me know if I can provide more info.

Awk34 commented 7 years ago

Thanks. This is a bug with this generator, as I found out after I investigated.

CleverCodingLab commented 6 years ago

use node v8.11.3