Bug in ionic 3? - please help

I downloaded Ionic 3 few days ago and everything worked just fine when all of the sudden yesterday this error showed up after every ionic command I tried to use inside and outside my project dir (ionic info, ionic serve, ionic start etc.):

{ Error at FatalException.Exception (C:\Users\X\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\cli-utils\dist\lib\errors.js:8:23) at FatalException (C:\Users\X\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\cli-utils\dist\lib\errors.js:17:9) at Config. (C:\Users\X\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\cli-utils\dist\lib\config.js:41:31) at throw (native) at rejected (C:\Users\X\AppData\Roaming\npm\node_modules\ionic\node_modules@ionic\cli-utils\dist\lib\config.js:5:65) name: ‘Exception’, exitCode: 1, fatal: true }
I have tried to delete ionic and cordova and reinstall many times using many different instructions I found online:

npm uninstall -g cordova ionic
npm cache clean -f
npm install npm -g
npm uninstall node
apt-get purge npm
apt-get install npm
npm install node -g
npm install -g ionic cordova

I made sure they were really installed and uninstalled via npm -g list --depth=0

I’ve also tried to delete and reinstall node (following this instructions) but this error stay with every version of ionic 3.X I tried.
ionic 2 on the other hand work great. any Idea what might have caused that and how to fix it?

I’m using:

Windows 10
npm : 4.6.1
node: v6.10.3
cordova: 7.0.1

version of ionic 3 I tried:


Are you talking about the Ionic CLI that you install via npm (npm install -g ionic) or the framework inside the app?
Post your npm list -g --depth=0 please.

yes I’m talking about the Ionic CLI I installed via npm

when I’m with ionic 2 and everything work it looks like that :
±- cordova@6.3.1
`-- ionic@2.1.0

when I’m with ionic 3:
±- cordova@7.0.1
`-- ionic@3.1.2

thank ahead :slight_smile:

So you also have a different Cordova version installed.

Try running e.g. ionic info with --verbose at the end.

just tried it but same error appear

What happens if you run cordova or ionic without anything else?

when I type ionic without anything else same error as above appear

when I type cordova without anything else it work as usual :

cordova command [options]

Global Commands
create … Create a project
help … Get help for a command
telemetry … Turn telemetry collection on or off
config … Set, get, delete, edit, and list global cordova options

Project Commands
info … Generate project information
requirements … Checks and print out all the requirements
for platforms specified

platform ........................... Manage project platforms
plugin ............................. Manage project plugins

prepare ............................ Copy files into platform(s) for building
compile ............................ Build platform(s)
clean .............................. Cleanup project from build artifacts

run ................................ Run project
                                        (including prepare && compile)
serve .............................. Run project with a local webserver
                                        (including prepare)

Learn more about command options using 'cordova help ’

build -> cordova prepare && cordova compile
emulate -> cordova run --emulator

-v, --version … prints out this utility’s version
-d, --verbose … debug mode produces verbose log output for all activity,
–no-update-notifier … disables check for CLI updates
–nohooks … suppress executing hooks
(taking RegExp hook patterns as parameters)

cordova create myApp org.apache.cordova.myApp myApp
cordova plugin add cordova-plugin-camera
cordova platform add android
cordova plugin add cordova-plugin-camera --nosave
cordova platform add android --nosave
cordova requirements android
cordova build android --verbose
cordova run android
cordova build android --release – --keystore="…\android.keystore" --storePassword=android --alias=mykey
cordova config ls
cordova platform add ios --nofetch
cordova plugin add cordova-plugin-camera --nofetch

Hm, so something is really broken with your ionic install. Can you uninstall again and make sure via npm -g list --depth=0 that it is really uninstalled?

yes I made suure , it really is deleted

Then show us the output of npm install -g ionic --verbose. Something has to go wrong there.

Next step: I see you are on windows. Unnstall npm and node and install nvm-windows. Use it to reinstall node and then try the command above again. This solves some rights stuff and makes node a lot more friendly on Windows.

1 Like

I managed to fix it ! There is a folder that don’t removed when uninstall under c:/users/{user}/.ionic , in there there is a config json file and in my case it was empty so I deleted the folder than reinstalled ionic and it worked ! :slight_smile:


Thank you Dude ! It’s working for me.

Thanks a lot! it worked. :smiley:

how to fix this on mac?

tried everything but its still not working

Find the .ionic folder and delete it before reinstalling Ionic CLI.

do you know where it’s located on mac?

No. Probably in the user directory as well.

okay found it, worked as soon as I deleted it. Thanks!

Could you share where the folder was located on Mac for future readers of this topic?

It was in the user directory (invisible) I was just blind lol