Ionic installation on macOs - ionic-framework

I am trying to install ionic and every time I try to install it says:
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
and I can't even check ionic -v to check version as it is not installed.
I can check npm version as it is installed correctly.
➜ ~ node -v
v8.7.0
➜ ~ npm -v
5.4.2
➜ ~ npm install -g cordova ionic
npm WARN deprecated node-uuid#1.4.8: Use uuid module instead
/Users/bilaltariq/.npm-packages/bin/cordova -> /Users/bilaltariq/.npm-packages/lib/node_modules/cordova/bin/cordova
/Users/bilaltariq/.npm-packages/bin/ionic -> /Users/bilaltariq/.npm-packages/lib/node_modules/ionic/bin/ionic
+ cordova#7.1.0
+ ionic#3.13.2
updated 2 packages in 27.258s

Had the same problem. The fix is to install ionic CLI globally:
As the developer user execute the following from your ionic project root directory:
npm uninstall ionic
then as user "root" execute the following:
npm i -g ionic#latest
after that, you should be able to use the new ionic CLI version 4.12.0

Related

I have upgraded to ionic 4 but my project doesnt support the version now I need to downgrade to ionic 3. What should i do? [duplicate]

The recent version is 3.2.0 and I'm facing lot's of issues with it like the ionic serve command not working.
npm install -g ionic#version_number
ex: if you want to install ionic 2.5.0,
npm install -g ionic#2.5.0
edit: to list all versions of ionic, npm info ionic
You can downgrade to your old version by running below command:
npm install -g ionic#3.9.2
Get your version here
IONIC CLI VERSIONS
You may try uninstalling it first: npm uninstall -g ionic
then install it again with the version that you want to install npm install -g ionic#x.x.x
then check ionic version with ionic --version you may need to restart your terminal to get the latest version running
First thing first, uninstall the current version:
npm uninstall -g ionic
then, install the version you want :
npm install -g ionic#"the version for example #3.20.0"
You just need to do like this:
npm install -g ionic#3.1.0
Changelog
Sometimes it throws error while overwriting the existing files , so add --force
Ex, If you want to downgrade to version 3.20, run:
npm i -g ionic#3.20 --force

Upgrade Ionic to latest version

I am trying to upgrade Ionic to the latest version. Looking here, it shows that the latest version is 3.0.0. I also follow this tutorial.
So I do the following:
sudo npm uninstall -g ionic
sudo npm install -g ionic#latest
console:
Richards-MacBook-Pro:theWhoZoo richardmarais$ sudo npm install -g ionic
Password:
/Users/richardmarais/npm-global/bin/ionic -> /Users/richardmarais/npm-global/lib/node_modules/ionic/bin/ionic
/Users/richardmarais/npm-global/lib
└── ionic#3.0.0
But when I run:
ionic -v
I get:
2.1.18
and:
ionic info
I get:
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v7.10.0
Xcode version: Xcode 8.3.2 Build version 8E2002
I would expect it to update the Ionic CLI Version: 2.1.18 to 3.0.0. Is that a correct assumption? If so, do you know what I am doing incorrectly?
Thanks
We did big chat. Things which were helpful:
Be sure that you completely delete all previous version with npm uninstall -g ionic or manually from rm -rf /usr/local/lib/node_modules. Don't forget remove symlink too: rm -rf /usr/local/bin/ionic
After completely deletion you should see error: command not found of ionic -v
And now if your npm root -g path is right like /usr/local/lib/node_modules try to install npm install -g ionic#latest. Then you should get correct output of ionic -v
The ionic CLI package has been renamed #ionic/cli
https://twitter.com/ionicframework/status/1223268498362851330
So you should uninstall ionic from your global
npm uninstall -g ionic
and add the new package name.
npm install -g #ionic/cli#latest
In case anyone comes here from google.
I simple run
$ ionic --version
$ 4.2.1
$ sudo npm i -g ionic#latest
$ ionic --version
$ 4.8.0
I would start trying the simple things before.
I just ran...
npm --version
Then, the answer was...
4.6.0
╭──────────────────────────────────────╮
│ │
│ Update available 4.6.0 → 4.12.0 │
│ Run npm i -g ionic to update │
│ │
╰──────────────────────────────────────╯
So, I did...
npm i -g ionic to update
After that...
npm --version
6.5.0

Error installing ionic on Mac OS

I'm trying to install the ionic on but it has error.
I've checked other articles here, but their solution does not help.
I am using the command:
sudo npm install -g ionic cordova
I am with:
$ npm --version
3.10.9
$ node --version
v6.9.2
And the error:
UPDATE:
There are mentions of this on the ionic forums if you do a search there
What I would so is completely remove ionic and Cordova by running
npm uninstall -g cordova
And
npm uninstall -g ionic
Then I would start the process again with
npm install -g cordova ionic
Just note that this docs say to install Cordova and then Ionic whereas it looks like you did it the other way around which could have caused some issues.

Ionic still creates v1 projects even after upgrading v2

I'm trying to start an Ionic v2 project following the official docs here, but I end up with an Ionic v1 project every time. My steps:
Remove current ionic and install the beta:
$ npm uninstall ionic -g
$ npm install ionic#beta -g
/Users/mike/.npm-global/bin/ionic -> /Users/mike/.npm-global/lib/node_modules/ionic/bin/ionic
/Users/mike/.npm-global/lib
└── ionic#2.0.0-beta.32
Create a new Ionic v2 TypeScript project:
$ ionic start ionic2-test --v2 --ts
Creating Ionic app in folder /Users/mike/dev/ionic2-test based on tabs project
Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
[=============================] 100% 0.0s
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
[=============================] 100% 0.0s
Updated the hooks directory to have execute permissions
Update Config.xml
Initializing cordova project
Adding in iOS application by default
But a v1 project is created:
$ cat ./ionic2-test/www/lib/ionic/version.json
{
"version": "1.3.1",
"codename": "el salvador",
"date": "2016-05-12",
"time": "18:21:10"
}
$ head -2 ./ionic2-test/www/lib/ionic/js/angular/angular.js
/**
* #license AngularJS v1.5.3
My ionic info:
Cordova CLI: 5.4.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic CLI Version: 1.7.8
Ionic App Lib Version: 0.6.4
ios-deploy version: Not installed
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.3 Build version 7D175
What am I doing wrong?
So, the problem is that the Ionic CLI is not being updated to the latest one (2.0.0 beta-32). Have you tried by doing this:
After $ npm uninstall ionic -g, update npm and clean npm's cache:
npm cache clean -f
npm install npm -g
Delete manually any folder containing references to Ionic like those you've included in the question:
/Users/mike/.npm-global/bin/ionic
/Users/mike/.npm-global/lib/node_modules/ionic/bin/ionic
/Users/mike/.npm-global/lib
And then after that:
$ npm install -g ionic#beta
or (on Mac and Linux you’ll need to add sudo to install Ionic globally):
$ sudo npm install -g ionic#beta
#sebaferreras lead me to the solution.
Even after sudo npm uninstall ionic -g, the ionic command was still available:
$ which ionic
/usr/local/bin/ionic
So I think I must have had it installed in multiple places. There seemed to be something generally screwed up with my node installation (I possibly installed from homebrew as well as from the official .pkg download), so I decided to completely remove it all and start from scratch, as described here:
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
I then reinstalled node using the official .pkg from their website, su-did npm install -g ionic#beta, and now...
$ ionic info
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
...
So I'm all fixed up!
this link will solve and save your time: http://ionicframework.com/docs/v2/getting-started/installation/
the simple way to create a ionic project: go to your into the directory where you want to create you project and the type this cmd:
ionic start cutePuppyPics --v2
Your Ionic CLI is not updated yet. Just run the command "npm install ionic cordova" once again, no need to uninstall the previous version manually. It will override the previous version automatically.
Just for your future help: To build you first app in Ionic, You might need to update jdk to 1.8, sdk to latest one from sdk manager (no need to change target sdk) and the first build will download a number of Gradle files, so, good Internet connection is needed.

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