-bash: cordova: command not found; or -bash: phonegap: command not found -


i not going ask question, answer one, have found advice online far , have figured out myself. it's share, right?


so on command line, did this:

sudo npm install -g cordova sudo npm install -g phonegap 

which worked fine, when ran either of these lines:

my-macbook-pro:~ username$ cordova my-macbook-pro:~ username$ phonegap 

i got these messages:

-bash: cordova: command not found -bash: phonegap: command not found 

why? turned out permissions on /usr/local/lib directory set "everyone: no access". changed "everyone: read only" , tried again.

my-macbook-pro:~ username$ cordova my-macbook-pro:~ username$ phonegap 

this time worked! test turned "everyone: no access" see if problem. time got different messages:

-bash: /usr/local/bin/cordova: permission denied -bash: /usr/local/bin/phonegap: permission denied 

the outcome same though, not call either cordova or phonegap through command line (i'm including these last 2 denial messages in case searches on them).

i'm on mac os mountain lion. after several attempts, turns out solution pretty quick.

before installing cordova, make sure owner of folders it's going install into. open terminal , type:

sudo chown -r $user /usr/local sudo chmod -r 0775 /usr/local npm install -g cordova 

if installed new version of node.js, still error. try deleting npm cache:

sudo npm cache clear npm install -g cordova 

then type cordova , luck ;)

edit: seems working on maverick, yosemite, el capitan , sierra well


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

php - joomla get content in onBeforeCompileHead function -