0

so I have installed cordova using the following command to use it globally

sudo npm install -g cordova

and I get the following message

/Users/safwany/.node/bin/cordova -> /Users/safwany/.node/lib/node_modules/cordova/bin/cordova
cordova@5.1.1 /Users/safwany/.node/lib/node_modules/cordova

I keep typing cordova in the terminal but I am getting command not found. The only I can get it working is by typing the following:

/Users/safwany/.node/lib/node_modules/cordova/bin/cordova

Any idea how can I change that so I can use it globally by just typing cordova ?!

omarsafwany
  • 3,695
  • 8
  • 44
  • 75

1 Answers1

2

This seems to be a problem with the CHMOD rights of your folders. Try to own the folders like this:

sudo chown -R $USER /usr/local
sudo chmod -R 0775 /usr/local

after that, clear the npm cache with

sudo npm cache clear

finished? Go on by installing cordova again ->

sudo npm install -g cordova

type cordova into your terminal and everything should work like a charme.

Source: https://stackoverflow.com/a/19113963/3671726

Community
  • 1
  • 1
Sithys
  • 3,655
  • 8
  • 32
  • 67