//run this command to make sure that the installation directory is correct sudo npm config set prefix /usr/local //then install cordova sudo npm install -g cordova@latest