Error occurred while loading plugins. CLI functionality may be limited (No CLI project!)

While running $ionic serve I get the error saying “Error occurred while loading plugins”. So here’s the result of the command used with Verbose flag,

$ ionic serve --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/USER/dir', local: true, binPath:
    '/usr/local/lib/node_modules/ionic/bin/ionic', libPath:
    '/Users/USER/div/node_modules/ionic/dist/index.js'
    }
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] Detected ./gulpfile.js in project directory
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova 3
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for local @ionic/cli-plugin-cordova 3
[DEBUG] Loading local plugin @ionic/cli-plugin-gulp
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic1
[ERROR] Error occurred while loading plugins. CLI functionality may be limited.
[DEBUG] Plugin error: PLUGIN_NOT_INSTALLED
[DEBUG] New daemon pid: 33061
[DEBUG] Getting plugin info for ionic
[DEBUG] Checking for latest plugin version of ionic@latest.
[DEBUG] Getting plugin info for @ionic/cli-plugin-proxy
[DEBUG] Checking for latest plugin version of @ionic/cli-plugin-proxy@latest.
[WARN] There was no CLI project plugin that responded to ionic serve.
   Make sure you have the Ionic CLI and a suitable project plugin installed locally.

So, naturally I tried removing and reinstalling ionic,

$ npm install --save -g ionic@latest
$ npm install --save-dev -g --save-exact @ionic/cli-plugin-cordova

These steps were performed successfully! However the error still remains. Also if I try to remove the -g flag from the above two commands, it throws these warnings,

npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/@ionic/cli-plugin-cordova 3/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/@ionic/cli-utils 2/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/xmlbuilder/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/@ionic/cli-utils 3/package.json'
npm WARN tempNew@0.0.1 No repository field.
npm WARN tempNew@0.0.1 No license field.

Some related devDependencies in package.json:

"@ionic/cli-plugin-cordova": "1.6.2",
"ionic": "3.7.0",
"@ionic/cli-plugin-proxy": "1.4.1",
"@ionic/cli-utils": "1.7.0",
"@ionic/cli-plugin-ionic1": "2.1.1",

ionic info:

[ERROR] Error occurred while loading plugins. CLI functionality may be limited.

cli packages: (/Users/USER/dir/node_modules)

    @ionic/cli-plugin-proxy : 1.4.1
    @ionic/cli-utils        : 1.7.0
    ionic (Ionic CLI)       : 3.7.0

System:

    Android SDK Tools : 25.2.5
    Node              : v7.8.0
    OS                : macOS Sierra
    Xcode             : Xcode 8.3.3 Build version 8E3004b
    ios-deploy        : 1.9.1
    ios-sim           : 5.0.13
    npm               : 4.2.0

But the initial error still remains. Can anyone please guide me how to make this work?
Also If you could explain those 2 and 3 in these warnings:

npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/@ionic/cli-plugin-cordova 3/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/USER/dir/node_modules/@ionic/cli-utils 2/package.json'

What is your ionic info output?

That looks very not good. There should be no " 2" or " 3" in these.

Hi @Sujan12,
I have updated the question with the output of ionic info. Please have a look at it again.

I managed to remove this error by removing almost everything (node_modules), uninstalling ionic globally and then reinstalling them! I still have no idea what caused it!

1 Like