It appears Ionic has started auto update recently.
This is the second time it asked me if I want to update. If I say NO, my apps build fails with the following message:
$ ionic cordova run android
? The Ionic CLI has an update available (3.5.0 => 3.6.0)! Would you like to ins
[OK] Not automatically updating your CLI. You can update manually:
npm install -g ionic@latest
? Local plugin @ionic/cli-plugin-cordova has an update available (1.4.1 => 1.5.
[OK] Not automatically updating @ionic/cli-plugin-cordova. You can update
manually:
npm install --save-dev --save-exact @ionic/cli-plugin-cordova@latest
? Local plugin @ionic/cli-plugin-ionic-angular has an update available (1.3.2 =
[OK] Not automatically updating @ionic/cli-plugin-ionic-angular. You can update
manually:
npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --externalIpRequired --nobrowser
[14:11:59] build dev started ...
[14:11:59] clean started ...
[14:11:59] clean finished in 106 ms
[14:11:59] copy started ...
[14:12:00] transpile started ...
[14:12:13] typescript: C:/MyApp/src/app/app.module.ts, line: 27
Argument of type '{ declarations: (typeof UserLoginPage | typeof DashboardPage | t...' is not assignable to parameter of type 'NgModule'. Types of property
'providers' are incompatible. Type '(typeof SplashScreen | typeof NetworkService | typeof Push...' is not assignable to type 'Provider[]'. Type 'typeof SplashScreen | typeof
NetworkService | typeof Push...' is not assignable to type
'Provider'.
L28: declarations: [
[WARN] Error occurred during command execution from a CLI plugin
(@ionic/cli-plugin-cordova). Your plugins may be out of date.
Error: Failed to transpile program
And if I say YES, the update FAILS with following message and Ionic gets corrupted or something because of which the âionicâ command doesnât work.
$ ionic cordova run android
? The Ionic CLI has an update available (3.5.0 => 3.6.0)! Would you like to ins
> npm install -g ionic@latest
Ă Running command - failed!
Exception: npm ERR! path C:\Users\myUser\AppData\Roaming\npm\ionic
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\myUser\AppData\Roaming\npm\ionic'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\myUser\AppData\Roaming\npm\ionic'
npm ERR! at Error (native)
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\myUser\AppData\Roaming\npm\ionic'
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\myUser\\AppData\\Roaming\\npm\\ionic' },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\\Users\\myUser\\AppData\\Roaming\\npm\\ionic' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myUser\AppData\Roaming\npm-cache\_logs\2017-07-27T18_14_32_729Z-debug.log
This is the message I get when I try to run Ionic command after above error:
$ ionic cordova run android
bash: /c/Users/myUser/AppData/Roaming/npm/ionic: No such file or directory
My ID does have administrator rights on this computer.
The only solution I got is to re-install Ionic and all other stuff.
Very frustrating!
Does anybody else get this?