Build error on Cocos2d-x JS / [Cocos 2.1]

I didn’t use that method. I will let you know my install process.

Follow next steps

1) Python Installation

Most of the time, you will be dealing with the Cocos console to create, run, compile,
and deploy your project. The console uses Python. So, the first thing you need to do is to install Python. You can download it from the official Python site at Download Python | Python.org.

If you are developing on MacOS X, it comes with Python installed by default.

2) Cocos Console Setup

For Cocos2d-js, the development environment is actually a part of the Cocos console, so you have to download the Cocos2d-x bundle, or you may also go for the HTML5 Lite version if you wish to develop only for the Web.

• Download the cocos2d-x bundle from https://cocos2d-x.org/ download.
• Extract the zip file to your local drive.
• Open the terminal on Mac or the command prompt on Windows
and navigate to the extracted folder.
• Run the following command:

And, typing follow line in command

python setup.py

• This will set up the Cocos console, which uses both Android and iOS environment settings, and update the environment variables.

3) Creating Your First App

Create a separate folder of your choice in your favorite location. It is good practice to keep all of your Cocos2d-js projects within one root folder.
Open the terminal and navigate to the created folder path, then execute the following commands:

• Cocos2d-js project:

cocos new sampleproject -l js

1 Like