Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-bash: ionic: command not found (Not able to install any version)

I am trying to install ionic globally.

sudo npm install -g cordova ionic AND npm install [email protected] --save

I tried both the commend it execute successfully.

But when i run ionic info it shows -bash: ionic: command not found

Can anyone help me?

EDIT : Same thing happen when i install cordova

    sudo npm install -g cordova
Password:
/Users/hardik/.npm-packages/bin/cordova -> /Users/hardik/.npm-packages/lib/node_modules/cordova/bin/cordova
+ [email protected]
updated 1 package in 7.011s
Sshah-Mac-mini:node_modules sunny$ cordova -v
-bash: cordova: command not found

Terminal Log

  Sshah-Mac-mini:~ sunny$ npm list -g --depth=0
/Users/hardik/.npm-packages/lib
├── @angular/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]

    Sshah-Mac-mini:~ sunny$ npm root -g
    /Users/hardik/.npm-packages/lib/node_modules


       ╭───────────────────────────────────────────────────────────────╮
       │                                                               │
       │       New minor version of npm available! 6.7.0 → 6.9.0       │
       │   Changelog: https://github.com/npm/cli/releases/tag/v6.9.0   │
       │               Run npm install -g npm to update!               │
       │                                                               │
       ╰───────────────────────────────────────────────────────────────╯

        Sshah-Mac-mini:~ sunny$ npm install -g npm
        /Users/hardik/.npm-packages/bin/npm -> /Users/hardik/.npm-packages/lib/node_modules/npm/bin/npm-cli.js
        /Users/hardik/.npm-packages/bin/npx -> /Users/hardik/.npm-packages/lib/node_modules/npm/bin/npx-cli.js
        + [email protected]
        updated 1 package in 16.501s
        Sshah-Mac-mini:~ sunny$ ionic info
        -bash: ionic: command not found
        Sshah-Mac-mini:~ sunny$
like image 788
Sunny Shah Avatar asked Mar 07 '19 06:03

Sunny Shah


1 Answers

This command show globally available modules in npm

npm list -g --depth=0

if you cant see ionic cordova in this list it means both packages are not installed globally.

check your global installation path by

npm root -g

check if your ionic and cordova installed in this directory or not. if you have tried path changing in first answer and still not working then uninstall node and install latest recommended version of node.

then install

npm install -g ionic
npm install -g cordova 
like image 81
Sahil Avatar answered Oct 17 '22 06:10

Sahil