Reputation: 445
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.
The syntax I'm using: "ionic g page TestPage"
It returns an error (below). Does anyone know how to resolve this error? It seems the "templates" directory does not exist on my machine which I gather is why this is happening, but not sure how to get it there or fix the issue. The first part of the path does exist: C:\apps\sampleapp\node_modules\ionic-angular\, but not the "templates/page" part.
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
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.1.0-beta.1
Ionic App Lib Version: 2.1.0-beta.0
OS: Windows 8.1
Node Version: v4.5.0
Upvotes: 6
Views: 4663
Reputation: 11
npm i -g [email protected]
resolved the issue for me, was previously on ionic 2.0.0 beta 11
Upvotes: 0
Reputation: 9062
Okay, for anyone where downgrading is not an option:
The Ionic Team did some major API updates and some restructuring. You need to follow these upgrade steps:
Sidenote: If you did uninstall and reinstall the package AND did run the command with sudo
and hit the command ionic start --v2 myApp
in the same terminal, then you need to update the rights in your folder with:
sudo chown -R username ./pathToAppFolder
https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#steps-to-upgrade-to-rc0
Upvotes: 0
Reputation: 89
Downgrade your ionic version to beta 22.. I think it works by uninstalling and then updating npm just in case and then reinstalling a lower ionic version.
How do you completely remove Ionic and Cordova installation from mac?
And I would suggest trying "npm install" in the project directory after this too.
Upvotes: 2