Ionic CLI not respecting --v2 tag - ionic-framework

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!

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

Ionic Framework : How to Upgrade to Ionic 2

I use ionic stable version to build Hybrid Mobile Application and things going fine.
Now, I would like to use Ionic 2 for its components features. Hence, I have installed ionic on ubuntu as
$ npm install -g ionic#beta
And then start using ionic started template as
$ ionic start IonicMyV2 --v2
However, the above command always brings the stable version ionic template.
What I am doing wrong? What procedure do I have to follow to use Ionic 2?
My problem has been resolved by command
sudo npm install -g ionic#beta cordova
You can remove the need for sudo with npm by installing NodeJS via brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install node
node -v
npm -v
npm install -g ionic#beta
You should run below command for upgrade to ionic 2.
npm install -g cordova ionic

Cannot start an ionic 2 blank project

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.

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.