Ionic 6: unknown option '--npm-client' - ionic-framework

I have a project with ionic 6 and capacitor, when I run ionic serve it work like a charm and I can see the project in my browser, but then when I run ionic capacitor build android I got this error:
error: unknown option '--npm-client'
[ERROR] An error occurred while running subprocess capacitor.
I have tried to use this solution, but it didn't work.
It says to:
npm uninstall -g ionic
npm uninstall -g #ionic/cli
npm install -g #ionic/cli
but I still get the same error. Someone already got the same error before?
Thanks!

npm uninstall -g ionic
npm install -g #ionic/cli#latest
Try this

I fix it updating to the last version with this, because the upgrade commands didn't work for me.
cd /tmp
wget https://registry.npmjs.org/#ionic/cli/-/cli-6.19.0.tgz
sudo npm -g install cli-6.19.0.tgz

I had the same issue and had to upgrade from node 14 to node 16.15 to make it work.

This issue is caused by older version of ionic-cli, you should upgrade the CLI version.

Related

How this error occure in ionic installation?

I can't install ionic in windows 10 please help me to install and configure the ionic s/w
I already changed my node version and node-gyp command. but nothing changed
An error occurred while running node install (exit code 1)
Run this
first uninstall ionic completly
npm uninstall -g cordova
npm uninstall -g ionic
install again
npm install -g ionic

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

error 404 Not Found: #ionic/cli-utils#1.13.1 during npm install

After installing cordova using
npm install cordova -g
I tried to install ionic, using
npm install ionic -g
but got
404 Not Found: #ionic/cli-utils#1.13.1
combining both statements as
npm install cordova ionic -g
generates the same error.
What could be the problem here? I use Artifactory as node modules proxy by the way, which generally works well in my environment.

ionic1 error: TypeError: Cannot read property 'emit' of undefined

i am making a application using ionic1 and angularjs1.
Today, when i execute ionic serve command in terminal. then i got following error.
js#js:peoject$ ionic serve
[INFO] Starting server: --port=8100 --p=8100 --livereload-port=35729 --r=35729 --address=0.0.0.0 - Ctrl+C to cancel
TypeError: Cannot read property 'emit' of undefined
from last 2-3 months there was no any issue but today suddenly i faced with this issue.
My ionic version is 3.3.0
Is there anything update on ionic or what else? i dont understand.
I tried a lot and the solutions is very simple.
My previous version of ionic was 2.2.0
So, i downgrade the ionic version.
First, remove the ionic, then reinstall with your old version.
harish#harish: sudo npm uninstall -g ionic
harish#harish: sudo npm install -g ionic#2.2.0
or
harish#harish: sudo npm uninstall -g ionic
harish#harish: sudo npm install -g ionic#2.2.3
or
harish#harish: sudo npm uninstall -g ionic
harish#harish: sudo npm install -g ionic#2.3.0
Whatever the version is, just uninstall your latest ionic and install your old version.
Then the issue is solved.
I had the same error downgrade your ionic version.
sudo npm install -g ionic#2.2.3
This worked for me.
reinstall the ionic
npm uninstall -g cordova ionic
npm install -g cordova ionic
this solved my same problem

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.