Use the following statement to create a Cordova application:
The code is as follows |
Copy Code |
cordova-d Create Lzwmeapp Com.lzw.lzwmeapp Lzwmeapp
|
However, it was not possible to create it successfully, prompting an error as follows:
code is as follows |
copy code |
e:lzwme_app_ ANDROID>CORDOVA-D Create Lzwmeapp Creating a new Cordova project with Name "Hellocordova" and ID Io.cordova.hello Cordova "at location" E:lzwme_app_androidlzwmeapp " Using the stock Cordova Hello-world application. Requesting {"uri": "Https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-w orld.git;a=snapshot;h=3.4.0 ; sf=tgz "} ... Downloading Cordova library for www ... Error:connect etimedout at Errnoexception (net.js:904:11) at object.afterconnect [as OnComplete] (net.js:89 5:19) |
Obviously this is the download Cordova Hello World file failed. The main reason for the URL https://git-wip-us.apache.org/speed is too slow, easy timeout.
Workaround:
We can change the download address for this file by:
Open the Platforms.js file in the Cordova directory and modify the URL configuration address. Here can be modified for git attachment package download address, specific to the official GitHub find:
https://github.com/apache/
such as the main modified here is the following section of code:
The code is as follows |
Copy Code |
' Android ': { Parser: './src/metadata/android_parser ', URL: ' Https://git-wip-us.apache.org/repos/asf?p=cordova-android.git ', URL: ' https://github.com/apache/cordova-android/archive/3.4.0.tar.gz? ', Version: ' 3.4.0′ }, ' www ': { Hostos: [], URL: ' Https://git-wip-us.apache.org/repos/asf?p=cordova-app-hello-world.git ', URL: ' https://github.com/apache/cordova-app-hello-world/archive/3.4.0.tar.gz? ', Version: ' 3.4.0′ }
|
Other parts of the URL can also refer to the modification.
Of course, you can also manually download the corresponding compression package, put it on the local server, and then modify the corresponding file to download the address.