Unable to upgrade to cli 6

Hey guys,

I already built several production apps with ionic 5 myself and am happy with that.
Today I wanted to “just” tryout the vue starter tutorial an failed :frowning:

I started here:

npm install -g @ionic/cli@latest native-run cordova-res
/Users/henningjaeger/.npm-global/bin/ionic -> /Users/henningjaeger/.npm-global/lib/node_modules/@ionic/cli/bin/ionic
/Users/henningjaeger/.npm-global/bin/cordova-res -> /Users/henningjaeger/.npm-global/lib/node_modules/cordova-res/bin/cordova-res
/Users/henningjaeger/.npm-global/bin/native-run -> /Users/henningjaeger/.npm-global/lib/node_modules/native-run/bin/native-run

  • cordova-res@0.15.1
  • native-run@1.2.2
  • @ionic/cli@6.12.0
    updated 3 packages in 7.044s
    (base) Hennings-MBP-3:os_vue henningjaeger$ ionic info
    [WARN] You are not in an Ionic project directory. Project context may be missing.


Ionic CLI : 5.4.16


cordova-res : 0.15.1
native-run : 1.2.2


NodeJS : v12.18.3
npm : 6.14.6

Maybe I misunderstood something but I expected the ionic info version to be 6.12.0 as stated in the installation.

I tried opening a new terminal just to be sure. ionic info delivers the same feedback though.

After that I tried uninstalling ionic. I removed the bin as well and check that ionic info was dead after that -> worked well

Then I started the described above installation again, with the same result.

What am I doing wrong?
I am sitting on a Macbook if that is somehow helping

It is, because then I can recommend nvm without concern.

I noticed you being 99% right and on top of that very efficient, so I am sure your answer is helpful in the end. So I am guessing I am just not seeing how at the moment

How would a node version manager help me with my ionic version problem?
Pretty sure it is a dumb question, sorry for bothering you again :frowning:

Because the Ionic CLI is a globally-installed node package. Where globally-installed node packages get installed and how your environment (PATH settings especially) is configured in order for them to run properly is thoroughly dependent on how your node.js installation is done.

nvm standardizes that, and does so in a way that eliminates the biggest mistake that people tend to make which looks like this:

  • hurriedly paste a command you copied from some web page
  • hit a wall
  • get frustrated
  • listen to some bozo on the internet that tells you to do something with sudo
  • run some npm command as root
  • blow up file permissions all over the place
  • start getting EACCESS errors
  • now things are exponentially worse

So, there are a zillion ways that you may have installed Node.js in the first place, and the right way to resolve your problem is dependent on which one you chose. When you do it with nvm, then I know that you can follow nvm's excellent documentation (which, frankly, you probably won’t even need to use much, because generally speaking it just does what you expect it to do and gets out of your way).

Ok so my error is related to my node.js installation - hmm somehow I missed that possibility, sounds good. Thank you for your patience, i will try to get rid of node and startover with nvm

ok, I cleaned up everything about node on my os x (took quite some time)
then installed nvm like you advised.

installed ionic as described ran into another wall (for some reason AGAIN there appeared a node_modules folder in my home directory.

But then finally: cli 6 is there for me.