-
Notifications
You must be signed in to change notification settings - Fork 0
Installing Apache Cordova
Apache Cordova is a set of device APIs that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript. Combined with a UI framework such as jQuery Mobile or Dojo Mobile or Sencha Touch, this allows a smartphone app to be developed with just HTML, CSS, and JavaScript.
When you install packages via NPM, you have the choice of either installing them locally to a current project, or globally, meaning they are available anywhere on the system.
In general dependencies should just be installed locally to the project to avoid polluting your system with unnecessary junk, but for things like Cordova we probably want to install it globally as the cordova command line tool is used for various system wide tasks (e.g. creating a new project).
To install the Cordova command line tools you should do:
$ npm install -g cordovaThe -g flag there means install cordova globally. This step might fail depending on how you have configured Homebrew, as it will try to install the cordova executable into your /usr/local/bin folder. This might fail if you do not have write permissions to that folder. If this is the case use the sudo command to install it like this:
$ sudo npm install -g cordovasudo used like this means "execute the following command with full super user permissions", and will prompt you to enter your password to re-authenticate you.
To verify your installation, open a new terminal window and run:
cordova --versionwhich should print out the installed version of Cordova to the command line. At time of writing I have version 4.3.0 installed.