Upgrading Ionic


#1

I have ionic 2.2.2 installed and it all used to work some couple of months back. Now on attempt to “ionic create…” I get some errors ending with

 Unable to add plugins. Perhaps your version of Cordova is too old. Try updating (npm install -g cordova),  removing this project folder, and trying again: (CLI v2.2.2)

 Your system information:

 Cordova CLI: Not installed
 Ionic CLI Version: 2.2.2
 Ionic App Lib Version: 2.2.1
 ios-deploy version: Not installed
 ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed

Trying to upgrade with “npm install ionic-angular@latest --save --save-exact” results in:

npm WARN saveError ENOENT: no such file or directory, open 'c:\dump\package.json’
c:\dump
±- UNMET PEER DEPENDENCY @angular/common@4.0.0
±- UNMET PEER DEPENDENCY @angular/compiler@4.0.0
±- UNMET PEER DEPENDENCY @angular/compiler-cli@4.0.0
±- UNMET PEER DEPENDENCY @angular/core@4.0.0
±- UNMET PEER DEPENDENCY @angular/forms@4.0.0
±- UNMET PEER DEPENDENCY @angular/http@4.0.0
±- UNMET PEER DEPENDENCY @angular/platform-browser@4.0.0
±- UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@4.0.0
±- ionic-angular@3.0.1
±- UNMET PEER DEPENDENCY rxjs@5.1.1
`-- UNMET PEER DEPENDENCY zone.js@^0.8.4

npm WARN enoent ENOENT: no such file or directory, open 'c:\dump\package.json’
npm WARN ionic-angular@3.0.1 requires a peer of @angular/common@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/compiler@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/compiler-cli@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/core@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/forms@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/http@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/platform-browser@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of @angular/platform-browser-dynamic@4.0.0 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of rxjs@5.1.1 but none was installed.
npm WARN ionic-angular@3.0.1 requires a peer of zone.js@^0.8.4 but none was installed.
npm WARN dump No description
npm WARN dump No repository field.
npm WARN dump No README data
npm WARN dump No license field.

Trying to upgrade the CLI results in:

c:\dump>npm install -g ionic
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated node-uuid@1.3.3: Use uuid module instead
C:\Users\user1\AppData\Roaming\npm\ionic -> C:\Users\user1\AppData\Roaming\npm\node_modules\ionic\bin\ionic
C:\Users\user1\AppData\Roaming\npm
`-- ionic@2.2.2

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ionic\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN In ionic@2.2.2 replacing bundled version of cross-spawn with cross-spawn@4.0.2
npm WARN In ionic@2.2.2 replacing bundled version of mime-types with mime-types@2.0.14
npm WARN In ionic@2.2.2 replacing bundled version of semver with semver@4.2.0
npm WARN In ionic@2.2.2 replacing bundled version of form-data with form-data@0.2.0
npm WARN In ionic@2.2.2 replacing bundled version of request with request@2.51.0
npm WARN In ionic@2.2.2 replacing bundled version of ionic-app-lib with ionic-app-lib@2.2.1

How do I get Ionic working again?

I’m on Nodejs 6.10.0 and npm 3.10.10

Thank you


#2

Ionic CLI 2.2.2 is the newest stable version. It will use newest Ionic (Framework, ionic-angular) version when you create a new project.
You don’t seem to have Cordova CLI installed. Execute this command to do: npm install -g cordova.
By the way, what is this “ionic create …” command you mentioned?


#3

Always read all the changelog entries between the version of the framework you are coming from and going to. You have missed a bunch of steps about upgrading other (i.e. Angular) dependencies.


#4

Sorry meant ionic start not create.

Upgrading Cordova makes no diff.


#5

Looking at the homepage I see no links to changelogs. How can I access them?


#6

You are not updating but installing, your ionic info says “Cordova CLI: Not installed” in your initial post. ionic info should tell you which version is already installed.


#7

Here.


#8

C:\WINDOWS\system32>npm install -g cordova
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\user1\AppData\Roaming\npm\cordova -> C:\Users\user1\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\user1\AppData\Roaming\npm
`-- cordova@6.5.0

C:\WINDOWS\system32>ionic info


Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:

Please install your Cordova CLI to version >=4.2.0 npm install -g cordova


Your system information:

Cordova CLI: Not installed
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed


Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:

Please install your Cordova CLI to version >=4.2.0 npm install -g cordova



#9

Ok, something is not working on your system.

Does cordova -version output something?
Are you running the command line as admin? Why?


#10

Here I see instructions to make an existing app continue to work in latest ionic. What I was trying to do was follow the getting started instructions by creating a fresh app with ionic start myApp. This is where I get the error and


#11

Hmm. Your thread topic plus the many peer dependency failures on Angular 4 dependencies makes it look like you were working on an existing project. I guess I misunderstood.


#12

Here I see instructions to make an existing app continue to work in latest ionic. What I was trying to do was follow the getting started instructions by creating a fresh app with ionic start myApp. Where @ this url is this specific issue addressed pls?


#13

Pls find results of running cordova --version even after npm upgrade. I typically run as admin because npm stuff typically fail on my system without admin (likely cause its installed in the program files folder.) However this result is from not using admin, just to satisfy that constraint.

C:\Users\user1>npm install -g cordova
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\user1\AppData\Roaming\npm\cordova -> C:\Users\user1\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\user1\AppData\Roaming\npm
`-- cordova@6.5.0

C:\Users\user1>cordova -version
module.js:471
throw err;
^

Error: Cannot find module 'cordova-lib’
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)
at Object. (C:\Users\user1\AppData\Roaming\npm\node_modules\cordova\src\help.js:20:19)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)


#14

If you don’t get any better answers, you could try installing nvm-windows so that you can more easily isolate node installations.


#15

Yep, I would also advise you to uninstall everything and delete all files of it, then reinstall node via nvm-windows (put the directory not in your user or some special folder but directly on C:), then reinstall by following the Ionic documentation.


#16

ok thanks but is there an easy command to uninstall everything? and would other stuff dependent on my node installation still work?


#17

Did you ever post the results of doing


$ npm cache clean
$ npm install -g cordova

#18

Even after these run, ionic info shows:

Your system information:

Cordova CLI: Not installed
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed


Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:

Please install your Cordova CLI to version >=4.2.0 npm install -g cordova



#19

Yeah, looks like you need to delete and reinstall npm and NodeJS. I would suggest you search your hard drive for node-modules folders and put them all in the recycle bin before reinstalling. Something is corrupted somewhere.


#20

Nothing is ever easy with Node. Google for “uninstall node windows” and do all the things you can find there - reall scrub your system clean of it.

Only when you reinstalled node via nvm-windows. But this shouldn’t be too hard.