Ionic recommends installing a new version of the command-line interface (cli) regularly, such as before linking an app to Appflow via `ionic link` or `ionic start.
The command for installing the cli is
npm install -g ionic@latest, which does a Node Package Manager (npm) global install of the latest version of the Ionic cli.
If you run that command on a Mac or UNIX machine and get the error
Error: EACCES: permission denied, it means you don't have permission to write to the global directories used by npm.
There are a few ways to get around that error.
- Run the command as a super user via
sudo npm install -g ionic@latest. You then enter the system admin password, which is typically your computer password.
- If you can't use sudo, then you should either use a node version manager, or install to an directory you do have permissions for, and set the system path to reference it via a back profile. Both of these approaches are documented at npmjs.com.