Ionic page generator not working 2.0.0-beta.11

This may be just my lack of experience working with ionic 2 but I’m getting an error when tying to generate pages via the CLI. I seem to be missing the “templates” directory under node_modules/ionic-angular, but not sure how to get it there.

The syntax I’m using: ionic g page TestPage

It returns an error:

Error: ENOENT: no such file or directory, scandir 'C:\apps\sampleapp\node_modules\ionic-angular\templates\page'
    at Error (native)
    at Object.fs.readdirSync (fs.js:808:18)
    at getTemplatesInDir (C:\Users\m411\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\app-generator
    at Generator.renderAndWriteTemplates (C:\Users\m411\AppData\Roaming\npm\node_modules\ionic\node_modules\@ion
    at C:\Users\m411\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\app-generators\index.js:25304:26

Any idea why? or how I can fix this


I have the same with 2.1.0-beta.1

Yup,it seems to be specific to 2.1.0-beta.1 as you said @robindesu.

There is a bug open on this topic on GitHub.

I got the same error with ionic CLI version 2.1.0-beta.2

I’ve tried to downgrade to version 2.0.0 and it works:

sudo npm uninstall -g ionic
sudo npm install -g ionic@2.0.0

Hope it’ll be helpful :wink: