Raz Buchnik
Raz Buchnik

Reputation: 8411

Ionic is installed in node modules globally but I receive: -bash: ionic: command not found

I am trying to install Ionic, however after I am installing this using the: sudo npm install -g ionic it returns with the next error: -bash: ionic: command not found for every command I am trying to use with the ionic CLI.

I have found the ionic folder in: usr/local/lib/node_modules/ionic and tried to manually delete it by: rm -rf ionic and then tried to re-install it using the first command of installing ionic globally.

The ionic is getting created there but still receive the error of unknown command.

My npm version: 6.5.0, my node.js version: v9.2.0

Upvotes: 0

Views: 261

Answers (2)

Raz Buchnik
Raz Buchnik

Reputation: 8411

I have re-downloaded the Node.js from Node.js official website, re-installed and then did the sudo npm install -g ionic and it works. Node version was: v9.2.0 and now it's v10.15.1

Upvotes: 0

molamk
molamk

Reputation: 4126

Drop the sudo. This will cause the "normal" user to not have enough permissions to access the files written by the sudo user. Just install it like this

npm install -g ionic

Upvotes: 1

Related Questions