Impossible to update [resolved]

Hello,
I would like to update with npm i -g ionic but nothing to do it does not work

PS C:\Users\ludo\migration> ionic info
[ERROR] Error loading @ionic/schematics-angular package.json: Error: Cannot find module
        '@ionic/schematics-angular/package'
[ERROR] Error loading @ionic/ng-toolkit package.json: Error: Cannot find module '@ionic/ng-toolkit/package'
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.0.6 (C:\Users\ludo\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.17
   @angular-devkit/core       : 0.8.7
   @angular-devkit/schematics : 0.8.7
   @angular/cli               : 6.2.7
   @ionic/ng-toolkit          : not installed
   @ionic/schematics-angular  : not installed

Cordova:

   cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0)
   Cordova Platforms     : android 7.1.2, browser 5.0.4, ios 4.5.5

System:

   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Environment:

   ANDROID_HOME : not set

PS C:\Users\ludo\migration>

thanks

I tried

npm rm ionic

and

npm install -g ionic

and that’s what it gives

PS C:\Users\ludo\test> ionic info
[ERROR] Error loading @ionic/schematics-angular package.json: Error: Cannot find module
        '@ionic/schematics-angular/package'
[ERROR] Error loading @ionic/ng-toolkit package.json: Error: Cannot find module '@ionic/ng-toolkit/package'
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.0.6 (C:\Users\ludo\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-rc.1
   @angular-devkit/core       : 7.1.4
   @angular-devkit/schematics : 7.1.4
   @angular/cli               : 7.1.4
   @ionic/ng-toolkit          : not installed
   @ionic/schematics-angular  : not installed

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4

System:

   NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Environment:

   ANDROID_HOME : not set

hello,
have you installed that on your own? Npm says this package is depricated
Take a look to your package. json, if there is an entry of that, than comment it out and run
npm i

Otherwise no idea.
Best regrdas, anna-liebt

Hello,
I created a new project at the moment to see but I have the same thing

PS C:\Users\ludo\test2> ionic info
[ERROR] Error loading @ionic/schematics-angular package.json: Error: Cannot find module
        '@ionic/schematics-angular/package'
[ERROR] Error loading @ionic/ng-toolkit package.json: Error: Cannot find module '@ionic/ng-toolkit/package'
√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.0.6 (C:\Users\ludo\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0
   @angular-devkit/core       : 7.2.3
   @angular-devkit/schematics : 7.2.3
   @angular/cli               : 7.2.3
   @ionic/ng-toolkit          : not installed
   @ionic/schematics-angular  : not installed

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : not available

System:

   NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Environment:

   ANDROID_HOME : not set

PS C:\Users\ludo\test2>

Your Ionic CLI is still outdated. Current version is 4.9.0

Try:

npm rm -g ionic

and

npm i -g ionic

and then

ionic info

In your project, make sure that your package.json corresponds to this file. There shouldn’t be any @ionic/ng-toolkit or @ionic/schematics-angular, only @ionic/angular-toolkit.
Then run:

npm i

Hope that helps!

Hello,
Thanks for your feedback,
I did everything, the package.json are identical.
after npm i
my ionic info gives me the same thing
there is really something wrong :roll_eyes:

Hi,
I am on windows10 and found that even though I am running the cmdline as administrator installing ionic failed the first time with the message to try as administrator. I tried again immediately and it worked. With npm install @ionic/angular it failed the first time, but this time I had to close the cmdline, open it again and then it worked. I noticed that it started doing this with v4 rc’s.

Then your Ionic CLI update didn’t work. Do you get an error when you do:

npm i -g ionic

?

It should say something like + ionic@4.9.0.

here is when I do npm i -g ionic

PS C:\Users\ludo\test2> npm i -g ionic
C:\Users\ludo\AppData\Roaming\npm\ionic -> C:\Users\ludo\AppData\Roaming\npm\node_modules\ionic\bin\ionic
+ ionic@4.9.0
updated 1 package in 7.505s
PS C:\Users\ludo\test2>

OK, that looks good.

Now when you do

ionic start test-app blank
cd test-app
ionic info

Do you still get the error? Now ionic info should output ionic (Ionic CLI) : 4.9.0 and only check for @ionic/angular-toolkit and not the other two packages.

I just saw from your output above that you have a local ionic cli. Go to C:\Users\ludo and remove that one. Make sure it uses the ionic cli from C:\Users\ludo\AppData\Roaming\npm\node_modules\ionic\bin\ionic (where global installations of node modules are).

super is finally back in the order :slightly_smiling_face:

ionic info
PS C:\Users\ludo\test2> ionic info

Ionic:

   ionic (Ionic CLI)             : 4.9.0 (C:\Users\ludo\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0
   @angular-devkit/build-angular : 0.12.3
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.3
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v10.15.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

PS C:\Users\ludo\test2>

really thanks for that, I can now see my problem of deployment on emulator
thanks

ludo

1 Like