Cannot start an ionic 2 blank project - ionic-framework

I am trying to start an ionic 2 blank project but it always create an ionic 1 project. That's what I do:
npm install -g ionic#beta
ionic start Test --v2
but when I open the project it's still version 1. I have tried to remove ionic completely with:
sudo npm uninstall -g ionic
sudo npm uninstall -g ionic#beta
sudo npm uninstall -g cordova
but after that when I type "ionic" it's showing that I have ionic v1.7.14. (did it several times and there aren't any errors).

for a blank project you can give the following command
ionic start ProjectName blank --v2
for tabs template you can give
ionic start ProjectName tabs --v2
--v2 is for ionic 2 project
you can also include --ts for getting the typescript project
ionic start ProjectName blank --v2 --ts

As of now The --v1 and --v2 flags have been removed.
ionic 1 blank project
ionic start myapp blank --type ionic1
ionic 2 blank project
ionic start myApp blank
ionic 3 blank project
ionic start myapp blank --type ionic-angular

Actually, I found what was wrong. In the documentation it's written:
ionic start Example --v2
where it should be (at least in my case)
ionic start Example -v2

Best tutorial follow the below link
First of install latest Node 6 LTS and NPM 3+ in window machinne.
/>npm install -g ionic#latest
/>ionic start mySampleApp
/>cd ./mySampleApp
/>npm install -g cordova
For android
/>ionic cordova platform add android
For ios
/>ionic cordova platform add ios
/>ionic cordova run android
That’s all if any error or problem comes please comment below.
http://infiniteneed.com/setup-and-start-ionic-mobile-app-from-scratch-in-window-machine/

I believe you will also need ionic#beta - currently 2.0.19
npm install -g ionic#beta
The great thing is, you can still use this CLI to install/control/build Ionic#1.x apps - in fact, there's little difference to the user since Ionic v1 is still the default for ionic#beta.

Related

How to revert back to older version of Ionic

I am new in Ionic 3 CLI, I found that
Ionic run android no longer works,
It works as Ionic cordova run android,
Is there any way I can go back to IONIC older CLI?
Any help would be appreciated
Yes, You can downgrade angular-cli installation to 1 by running commands in terminal:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli#1.0.0

"ionic serve --lab" gives an error for ionic2

I used to create Ionic apps by
ionic start AppName blank --v2 and run with ionic serve --lab.
But now it gives:
"Error: ENOENT: no such file or directory"
What should I do?
I was able to run ionic lab as before after updating ionic. Must be due to a new release.
I just ran below in the terminal.
$ npm uninstall -g ionic
$ npm install -g ionic

npm uninstall not working for ionic

I have ionic cli installed in my PC
Windows 10 OS
as per new ionic release the beta has to be uninstalled and new ionic need to be installed.
https://github.com/driftyco/ionic/releases
But when I try to uninstall ionic using npm
npm uninstall -g ionic
also
npm uninstall -g ionic#2.0.0-beta.25
after uninstall
I did
npm list -g
the ionic was not shown in the output.
But upon everything when I type
ionic -v or ionic --version
I still see ionic 2.0.0-beta25 in my console.
Tried this multiple times and also there was a solution in forum by one who says there might be old entry. But I am not sure from where this is getting picked.
Is there a way to find out where npm is picking this or where it is installed?
I cant find it under my npm directory.
C:\Users\Bala\AppData\Roaming\npm\node_modules
Output of Where ionic
C:\>where ionic
C:\Program Files (x86)\nodejs\ionic
C:\Program Files (x86)\nodejs\ionic.cmd

Ionic CLI not respecting --v2 tag

I'm a long time Ionic user and set out to start my first Ionic 2 app. The docs say that this will work:
$ npm install -g ionic#beta
$ ionic -v => 1.7.10
$ ionic start newApp --v2
But when I run it my newApp is v1? I am running Node 4.1.
OP just needed to close the terminal and open it again.
Thanks #mhartington - needed to close and reopen my terminal!

Unable to add platform ionic platform add Android

Getting below error when running command ionic platform add android
Error: ENOENT, no such file or directory _____\.cordova\lib\android\cordova\3.5.1\VERSION'
I am providing step by step installation of ionic along with cordova.
Have a look it may help you :
First install node to get started using this link
open cmd to install cordova using following command
$ sudo npm install -g cordova
(Drop sudo from the above command if running on Windows)
install ionic using command
$ sudo npm install -g ionic
Create project after selecting directory where project file will be stored,
through CMD,by following command
ionic start {project name} {template type} e.g
ionic start todo blank
Once your project is created go to your newly created project: cd .\new project. for e.g.
D:\Projects>cd.\todo
Now you have to add both android and ios to your project in order to test the build so you need to follow below commands
ionic cordova platform add android
ionic cordova platform add ios
I think in your case you are missing step 5.