Download everything below:
After downloading everything above,
Inside your Cocos2d-x directory run:
caution: You must not use the ~ sign. Use the full path to your home directory. Otherwise, the scripts will fail due to error path value.
After setting the above environment variables,run:
Vola, the cocos2d-x has been successfully setup on your system.