ionic-team / ionic-cli

The Ionic command-line interface
MIT License
2k stars 653 forks source link

update ionic 3.15.1 erro: @ionic/discover #2838

Open SamuelKlein opened 7 years ago

SamuelKlein commented 7 years ago

Description: the update ionic to 3.15.1 show erro;

Output:

Error: Cannot find module '@ionic/discover'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

My ionic info:

[WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying ./bower.json.

cli packages: (/project/node_modules)

    @ionic/cli-utils  : 1.15.1
    ionic (Ionic CLI) : 3.15.1

global packages:

    cordova (Cordova CLI) : 6.0.0 

local packages:

    Cordova Platforms : android 5.1.1
    Ionic Framework   : ionic1 1.3.3

System:

    Node : v6.11.0
    npm  : 5.0.3 
    OS   : Linux 3.13

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

Other Information:

Solution: npm install --save @ionic/discover

imhoffd commented 7 years ago

That's odd, because we set it as a dependency here: https://github.com/ionic-team/ionic-cli/blob/master/packages/%40ionic/cli-utils/package.json#L40

Perhaps npm slipped up. Could you try reinstalling the CLI (after uninstalling @ionic/discover)?

SamuelKlein commented 7 years ago

the error occurs when I am running the ionic serve the solution npm install --save @ionic/discover

imhoffd commented 7 years ago

I understand. But your solution will add that as a dependency of your project, which may be undesirable. An alternative solution would be to try re-installing the Ionic CLI.

midas-phoenix commented 7 years ago

had this same error too but ionic doctor check solved it for me

liquidcms commented 6 years ago

I just updated from cli 2.2.1 to latest (3.20.0) and now when i do ionic info i get same error:

[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying .\bower.json.

i ran ionic doctor check and it says everything is ok

imhoffd commented 6 years ago

@liquidcms That's just a warning, not an error. With Ionic 1 projects the CLI is expecting a bower.json file. It's looking for the version of the framework, but it was able to find it elsewhere.