Software Installation

 

 

Environmental Paths

When an application runs from the CLI it often has to use other applications and data to complete various actions. So it needs to find these applications. To enable this process, the paths to all these applications and variable locations are stored either in the primary application itself or, in the present case, in the Environmental Variable list. Then the main application looks up the path, adds it to the application name and runs the application.

You can access these paths by right clicking the Start menu again, but this time selecting the System option. This opens the System window which is a regular windowed UI. One of the options, on the left, is the Advanced system settings. Clicking this opens the System properties window and clicking its Environmental variables button on the bottom right finally gets you to the Environmental Variables window. This has a panel with System variables that you may have to edit.

In Windows 11, open Windows prompt from All apps, System information, System summary, software environment, environment variables, then edit the path.

At this point you should be very careful since incorrect settings of these variables may cause your computer to behave badly.

If you have to edit a path variable you will find it listed in the lower pane. This is a list of paths separated by semicolons. It is probably too long to fit in the panel but clicking the value to select it then clicking the Edit button should list all the values in the path variable in a new window.

As an example, the first path we will look at is for a package called Node. This normally sets its own path so when you have installed it there should be an entry something like

C:\Program Files\nodejs\

This is the path to the Node software whose complete address is

C:\Program Files\nodejs\node

It is also the path to C:\Program Files\nodejs\npm which we will also use in the next section.

If the path you require is missing you should add it by clicking the New button and entering the path. If it is present but incorrect, you can edit it.  Of course, all of this activity calls for very careful typing.

If you have edited a path and want to keep the new value you should exit all the windows in reverse order by clicking their OK buttons. If you just exit the windows your path edits will not be saved.

If you have a correct path set to Node then opening the Command Prompt window and entering the command  node –v  should find node and display its version number. Otherwise you will get some sort of error message, in which case you have to go back and set the path again.

Installing Cordova

To install Cordova you have to first install Node. Cordova is a JavaScript app that is run by the Node runtime engine, node.js, so you start installing Cordova by installing node.js.  Then you use the Node package manager from the system command line to install Cordova. This installs the Cordova CLI which contains all the commands you need for hybrid development from the system command line.

Node             

This package can be installed directly from its website at https://nodejs.org/en/download. As usual with such downloads, you can download then run the app from the browser. Or when download is complete you can exit the browser and install the application by finding it in your Downloads folder and double clicking it. Node should set its own path in environmental variables and you can check that this has been done correctly with the system command

 node –v 

This should find node and display its version number. Otherwise you will get some sort of error message, and you should check that Node has been installed and set the path properly.

 

Cordova

Cordova is installed from the Command Prompt. You have to enter the command

 npm install –g cordova

As usual, it will install Cordova even if your use a lower case initial since that is the name of the application it will find. And the g switch simply makes it a global install with its path set.

You can check the success of your installation with

cordova –version

This should display the version number of Cordova.

Again, Cordova should set its own path variable but if the version number is not returned you should find where it has been installed, probably in your Program Files folder then make another trip to the environmental variables window and check that its path is correct.

If the command does display a version number, Cordova is installed along with a complete set of its own CLI commands. Now you can develop, test and run Cordova apps entirely from the Cordova CLI.