Ionic generate command not working

Another day and unfortunately another set of issues. I’m honestly not sure if I’m having terrible luck or whether the Ionic framework and CLI is just continually very buggy.

So I’ve updated to latest version of the CLI, also updated my version of Node.js. When I run the command 'ionic generate page checkout’ I get the following error:

Error: ENOENT: no such file or directory, scandir 'C:\Development\SeirseMobile\src\pages\node_modules\ionic-angular\templates\page’
at Object.fs.readdirSync (fs.js:911:18)
at readTemplates (C:\Development\SeirseMobile\node_modules@ionic\app-scripts\dist\generators\util.js:115:26)
at Object.generateTemplates (C:\Development\SeirseMobile\node_modules@ionic\app-scripts\dist\generators\util.js:287:12)
at Object.processPageRequest (C:\Development\SeirseMobile\node_modules@ionic\app-scripts\dist\generators.js:9:23)
at C:\Users\Ciaran\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\cli-utils\lib\ionic-angular\generate.js:28:34
at ()
at fulfilled (C:\Users\Ciaran\AppData\Roaming\npm\node_modules\ionic\node_modules\tslib\tslib.js:93:62)

Any ideas here?

Here’s my ionic info:

cli packages: (C:\Users\Ciaran\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.6.1


Node : v8.6.0
npm  : 5.3.0
OS   : Windows 10


backend : pro

Thank you so much for any help you can offer :slight_smile:

You should run the command in your project root, not in src\pages\ I guess.

1 Like

Thank you Sujan, I was just being silly then! :slight_smile: Apologies.

Don’t worry, didn’t know that myself. The CLI could anticipate this as well… if you want to you can create an issue at Github.

1 Like