Egret is developed based on TypeScript, while tsc is developed based on Node. js. Therefore, during the installation process, we must first install the basic support tools. The software to be installed is as follows:
Node. js
TypeScript
TypeScript code editor
HTTP server (optional)
Chrome (optional)
Egret
This document describes how to install Egret in Windows. The installation steps are as follows.
1. Install Node. js
1.1 download Node. js
The method for installing Node. js is very simple. You can visit the Node. js official website and click the INSTALL button on the page to directly download the msi installation package of Node. js.
At the time of this tutorial, the Node. js version is 0.10.29. If your version is later than this version, we will provide related version compatibility instructions. If no version compatibility instructions are provided, your version applies to Egret.
Double-click the msi installation package to install Node. js. Installation Process
The downloaded Node. js installation package
1.2 install Node. js
Start installation Interface
License authorization instructions
Select the installation directory and keep the default options
Select the installation content, and we will install all the kits
Confirm installation and click "Install ".
Installation Process
On the installation page, your Node. js is installed in the C: \ Program Files \ nodejs \ directory, and the installation package also installs the npm tool for you.
1.3 verify Node. js
After the installation is complete, start your command line tool and enter the node-v command to check your current Node. js version and verify whether your node. js is successfully installed. If the installation is correct, the effect is shown in.
Enter cmd in start --> Search to run the command line tool.
If the node is not an internal or external command, or a program or batch file that can be run, the installation fails. For details, refer to the following Node. js installation failure solution or help in our developer community.
1.4 npm Verification
Run npm in the command line tool. If the content appears, it indicates that your npm is correctly installed.
If npm is not an internal or external command, or a program or batch file that can be run, the installation fails. For details, refer to the following Node. js installation failure solution or help in our developer community.
1.5Node.js installation failure Solution
After some Windows installation is complete, enter node and npm in cmd, and you may be prompted that the command cannot be found. The new Path must be restarted to take effect. Restart or use the absolute path of node and npm to run the command.
2. Install TypeScript
2.1 install TypeScript
After node. js is successfully installed, the node and npm commands can be used. Directly use the npm command to install TypeScript directly. For detailed installation methods, refer to the official website of TypeScript.
Enter the following command in the terminal: npm install-g typescript
The npm install command is used to install the specified Node. js library in the developer's system. typescript is the name of the library, and-g indicates to install the Library to the Global Path.
If installation is slow due to network problems, use the npm install-g typescript -- registry = http://r.cnpmjs.org command to access the domestic image version for installation.
2.2 verify TypeScript
After the installation is successful, run the tsc command. You should see the following interface:
3. Install the TypeScript code editor.
3.1 select an appropriate code editor.
Egret can use any code editor that supports scripting languages, including:
Official WebStorm [official recommendations]
Microsoft Visual Studio 2012 + TypeScript plug-in
Sublime Text + TypeScript plug-in
For more information about how to install the editor and how to configure the plug-in, see the related tools section in this document.
4. install an HTTP server
4.1 select an appropriate HTTP server.
XMAPP is recommended for Windows users
You can skip this step and use the simple HTTP server built in Egret Based on Node. js. However, to ensure a better development experience, Egret recommends that you install the above mature HTTP server.
For more information about server software installation, see the related tools section in this document.
5. Install Chrome
Egret can run on the vast majority of modern browsers, but Egret currently recommends developers to use Chrome as the main development and debugging environment.
Open Chrome
Settings> Tools> JavaScript Console
In the JavaScript Console (lower-right corner), set (gear icon)-> common-> disable browser cache
After the preceding settings are completed, as long as the JavaScript console is open, no browser cache is available for debugging.
6. Download and install Egret
6.1 download Egret from the official website
Egret provides two download channels: Egret official download and Egret Github download.
We recommend that you download the stable version from the official website. If you download the development version of the engine from github and the version is unstable, you may encounter many problems in actual development. These problems are usually not found in the stable version.
Go to the official download page, find the "Egret engine" product item, and click the blue Download button to download the latest version of the Egret engine ,.
6.2 install Egret
Decompress the downloaded Egret engine package to the specified directory, which can be any directory on the disk,
Run the command in the command line tool to enter the decompressed directory. Because we place the decompressed file on the F: disk, we first enter the F disk, and the command is as follows:
F:
Then we enter the corresponding directory,
After entering the directory, run the installation command.
Npm install-g
If the installation command is incorrect, check the following three items to see if they are correct.
Whether the current path in the command is correct.
Whether the current directory is the Egret directory (a file named package. json exists in this directory)
Whether the current user of the system has administrator permissions. If you extract Egret to drive C, this problem may occur.
6.3Egret tool Verification
After the installation is complete, run the egret command to check whether the current Egret is successfully installed. If the installation is successful, see.
If the installation fails, Please seek help in our developer community.