You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/05/16 06:14:05 UTC

[GitHub] [cordova-docs] purplecabbage commented on a change in pull request #987: Prefer local cordova CLI with npx

purplecabbage commented on a change in pull request #987: Prefer local cordova CLI with npx
URL: https://github.com/apache/cordova-docs/pull/987#discussion_r284551478
 
 

 ##########
 File path: www/docs/en/dev/guide/cli/index.md
 ##########
 @@ -35,78 +35,54 @@ The Cordova command-line tool is distributed as an npm package.
 To install the `cordova` command-line tool, follow these steps:
 
 1. Download and install [Node.js](https://nodejs.org/en/download/). On
-   installation you should be able to invoke `node` and `npm` on your
+   installation you should be able to invoke `node`, `npm` and `npx` on your
    command line.
 
 1. (Optional) Download and install a [git client](http://git-scm.com/downloads), if you don't
    already have one. Following installation, you should be able to invoke `git`
    on your command line. The CLI uses it to download assets when they are referenced using a url to a git repo.
 
-1. Install the `cordova` module using `npm` utility of Node.js. The `cordova`
-   module will automatically be downloaded by the `npm` utility.
-
-   * on OS X and Linux:
-       ```bash
-       $ sudo npm install -g cordova
-       ```
+## Create the App
 
-       On OS X and Linux, prefixing the `npm` command with
-       `sudo` may be necessary to install this development utility in
-       otherwise restricted directories such as
-       `/usr/local/share`. If you are using the optional
-       nvm/nave tool or have write access to the install directory,
-       you may be able to omit the `sudo` prefix. There are
-       [more tips](http://justjs.com/posts/npm-link-developing-your-own-npm-modules-without-tears)
-       available on using `npm` without `sudo`, if you desire to do that.
+Go to the directory where you maintain your source code, and create a cordova project:
 
-   * on Windows:
-       ```
-       C:\>npm install -g cordova
-       ```
+```bash
+$ npx cordova create hello com.example.hello HelloWorld
+```
 
-   The `-g` flag above tells `npm` to install `cordova` globally. Otherwise
-   it will be installed in the `node_modules` subdirectory of the current
-   working directory.
+This creates the required directory structure for your cordova app. By default, the `cordova create` script generates a skeletal web-based application whose home page is the project's `www/index.html` file.
 
-   Following installation, you should be able to run
-   `cordova` on the command line with no arguments and it should
-   print help text.
+All subsequent commands need to be run within the project's directory,
+or any subdirectories:
 
-## Create the App
+```bash
+$ cd hello
+```
 
-Go to the directory where you maintain your source code, and create a cordova project:
+Until necessary adjustments have been made to Cordova to do this for your automatically, you're going to want to install the current version of Cordova into your new project:
 
 ```bash
-$ cordova create hello com.example.hello HelloWorld
+$ npm --save-dev cordova
 
 Review comment:
   `$ npm install --save-dev cordova`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org