In this post , I will give information about how to setup Cocos2d-js development environment.
First of all visit : http://cocos2d-x.org/download and Download Cocos2d-x zip file.
Note: Before Cocos2d-x V 3.9 its have two different package named (Cocos2d-x and Cocos2d-js). with V3.9 they released one package for all language which including C++,Lua and Javascript.
After downloading cocos2d-x zip file. Please unzip it.then come cocos2d-x-3.9 directory, run ./setup.py in the console.
You will need Android NDK ,SDK and ANT and their path must be provided in your computer. or you can set here. and you will need Python 2.7.5 Because this tool written Python 2.7.5 (32 bit). Python 3 not supported.
Note: please execute source ~/.bash_profile to make the environment setting take effect immediately.
After running setup you will see like this. if your Android NDK,SDK and ANT path is wrong or not provided you will get error.
if you get any error. Its means your setup is successful. Welcome to Cocos2d-x world :)
Now you can create Cocos2d-js project following this link