Unable to use generate, getting Unknown Generator Type error

Hi there,

I’m trying to create a page using generate command. I’m running the following:

ionic g testname page

But it fails and outputs the following:

Unknown Generator Type
undefined 'Component’
undefined 'Directive’
undefined 'Page’
undefined 'Pipe’
undefined 'Provider’
undefined ‘Tabs’

Ionic Info

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.1
Xcode version: Not installed

I think you have your arguments backwards.

Hi rapropos,

I moved the arguments around:

PS C:\MobileDev\site-manager-app> ionic g page testcom

Error: ENOENT: no such file or directory, scandir 'C:\MobileDev\site-manager-app\node_modules\ionic-angular\templates\page’
at Error (native)
at Object.fs.readdirSync (fs.js:951:18)
at getTemplatesInDir (C:\Users\bengrah\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\app-generators\index.js:23931:65)
at Generator.renderAndWriteTemplates (C:\Users\bengrah\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\app-generators\index.js:25309:116)
at C:\Users\bengrah\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\app-generators\index.js:25304:26

ENOENT: no such file or directory, scandir ‘C:\MobileDev\site-manager-app\node_modules\ionic-angular\templates\page’ (CLI v2.2.1)

Something is weird in your environment, because ionic g page foo creates things in src/pages/foo in my scratch project.

Any specific directory you suggest me checking?