I want to start using the ionic framework, but unfortunately I\'m already failing on the first step.
I am running Ubuntu 13.04 and I have node v0.10.25 installed. I\
First Solution
I recently ran into this issue and the only solution that worked for me was to uninstall both ionic and cordova.
npm uninstall -g cordova
npm uninstall -g ionic
Then just reinstall
npm install -g cordova
npm install -g ionic
Second Solution
I ran into this issue again! This time check your environmental variables.
Run npm bin -g
and check if the path returned is in your environmental variables. For me, it prompted that it was not found in the terminal output. I added that path to the environmental variables and restarted the terminal. From there everything started to work again. (source)
this worked for me. try adding below to the ~/.bash_profile for mac OSX el capitan users:
NPM_PACKAGES="${HOME}/.npm-packages"
NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$NPM_PACKAGES/bin:$PATH"
# Unset manpath so we can inherit from /etc/manpath via the `manpath`
# command
unset MANPATH # delete if you already modified MANPATH elsewhere in your config
MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
then run source ~/.bash_profile
to reload the profile in terminal.
additional info: node v4.3.1
I also faced same problem but i solved i used following commands on terminal it worked
sudo npm uninstall ionic
then i used
and it worked fine it automatically installs best stabel version of cordova and latest stable version of ionic . for me it installed ionic 3.7.0 and cordova 7.0.1
for some of you, the two answer above might not work. here's a more general solution for situation where you see "XX" command not found
first check your npm root
and npm root -g
the result for the npm root -g
should be something like "/usr/local"
.
if it's not, then you found your problem.
change it by:
npm config set prefix /usr/local
then npm root -g
should give you something like /usr/local/lib/node_modules
.
Then go ahead re-install everything with -g
you will be good to go!
The package name has changed from ionic to @ionic/cli! To update, run: npm uninstall -g ionic Then run: npm i -g @ionic/cli
For Mac users
1. install the ionic
npm i -g @ionic/cli
2. check npm path
npm root -g
3. copy full path of ionic
Ex. /usr/local/Cellar/node/15.2.1/lib/node_modules/@ionic/cli/bin
4. open this file as administrator "/etc/paths" with nano or whatever editor
Ex. sudo nano /etc/paths
5. Add ionic bin file full path to file ends. And save file.
That's it.