How to use Ionic CLI with pnpm - ionic-framework

How is it possible to use pnpm instead of npm with ionic cli?
it has some good benefits rather than npm, Like smaller storage usage, Showing progress when some package is downloading and etc...

Run this command to change the default package manager of ionic CLI from npm to pnpm:
ionic config set -g npmClient pnpm
also if you want to use yarn instead of npm :
ionic config set -g npmClient yarn

Related

Upgrade Ionic 5.0 to 5.3 Commands

What is the proper set of npm commands to update Ionic from v5.0 to v5.3.1 (latest release), as well as, bump the version of Capacitor, Ionic Native, and the dev dependencies appropriately?
I can't find an update guide with commands in the Ionic docs unlike in Angular where you would follow the update steps on https://update.angular.io. They don't seem to indicate whether the CLI version should match the Ionic version, or whether the version of Capacitor for a specific version of Ionic or the CLI is required, or if none of that matters.
Would I run these commands:
// dependencies
npm install #capacitor/android#latest
npm install #capacitor/core#latest
npm install #capacitor/ios#latest
npm install #ionic/core#latest
npm install #ionic-native/core#latest
npm install #ionic-native/in-app-browser#latest
npm install #ionic-native/splash-screen#latest
npm install #ionic-native/status-bar#latest
npm install #ionic/angular#latest
npm install #ionic/storage#latest
// dev dependencies
npm install #capacitor/cli#latest
npm install #ionic/angular-toolkit#latest
npm install #ionic/lab#latest
or equivalently just run npm upgrade <LIST_OF_ABOVE_PKGS>? and are there dependencies between Ionic, Ionic CLI, Capacitor, and Ionic Native?
run at cmd in "npm install -g ionic#5.3.2"

How to solve: Detected locally installed Ionic CLI, but it’s too old -- using global CLI?

ionic -v results in this warning:
[WARN] Detected locally installed Ionic CLI, but it’s too old -- using global CLI.
How to uninstall local Ionic CLI?
ionic-cli has been updated to version 4.0.1 a couple of days ago.
https://github.com/ionic-team/ionic-cli/blob/develop/CHANGELOG.md
You should remove local cli by npm remove ionic --save-dev and use global one instead.
npm i -g ionic
PS: For ionic v1 project, you have to install #ionic/v1-toolkit now.
https://www.npmjs.com/package/#ionic/v1-toolkit
I had this issue on my app as well.
I no longer had '#ionic/cli' or 'ionic' as a dependency, but every time I re-ran "npm i" it would return as a locally installed item. Looking through my package-lock.json I saw that it was also being installed as a dependency of #types/ionic which I then removed and solved this issue as well.
Remove old ionic:
npm remove ionic
And then install ionic v 4.0.1:
npm install ionic#latest --save
Remove local Ionic CLI npm package:
npm rm ionic --save

Ionic and cordova(Latest versions) installation problems

I'm trying to install the Ionic framework with npm. It successfully installed. But when I try installing new versions of Ionic and Cordova, I was unable to install and Error messages are coming frequently in the ubuntu terminal.
I had a same problem but i recovered it using following command:
npm install -g cordova ionic --verbos
if its not work then you need to try yarn. you can download and install form https://yarnpkg.com/lang/en/docs/install/ this website
After install, run the following command
yarn add global cordova
yarn add global ionic

Ionic CLI not updating on MAC

I have been trying to update Ionic CLI, I can use the install from NPM and it says it is installing version 2, but if I run Ionic --v it returns 1.7.15. I am guessing it is installed locally, but not sure how I can remove it to let it use the updated global one. I have tried manually deleting from the user node_modules and that. Any ideas?
You should just be able to run npm install -g ionic#2.2.2 in terminal and it will update the global version of ionic.
If that doesn't work then just remove ionic (npm uninstall -g ionic) and install again using the command above.

How can I update to the not yet officially released Ionic 1.2?

Ionic 1.2 has been announced:
http://blog.ionic.io/announcing-ionic-1-2/
The source code is availible here:
https://github.com/driftyco/ionic/releases/tag/v1.2.0
But I haven't been able to install with with some shell commands that I have attempted:
$ bower install --save ionic#1.2.0
$ bower install https://github.com/driftyco/ionic/archive/v1.2.0.tar.gz
$ bower install driftyco/ionic-bower#v1.2.0 --force
I can download the source code but don't know how to use it to update my ionic framework
You can install it with bower using:
$ bower install ionic#1.2.0 --force
Anyway, you should take into account that this will only download libraries and source code, but not a CLI tool.
So in my opinion, if you want to test ionic 1.2, you should
Create an ionic project (as usual)
Perform bower install ionic#1.2.0 --force, in order to get the new ionic libs
Replace in your project the content of www/lib/ionic/ with the content of the recently downloaded bower_components/ionic/release/.
DETAIL: Ionic uses to include a .bowerrc file that causes bower packages to be placed in www/lib, instead of inside bower_components, so maybe you'll simply need to replace the content of www/lib/ionic/ with www/lib/ionic/release (--force is need because www/lib/ionic already exists).