Difficulty: (Intermediate-Advanced)
Intro
Ever wanted to “hack” CodeCombat and help contribute in making CodeCombat better? (There are two types of hacking, white-hat hacking, and black-hat hacking. White hat hacking is to help fix problems and stop black-hat hackers, and black-hat hacking is malicious hacking/cheating.) Do you find the current guide way too confusing? I’ve simplified the current guide so you can understand it. Use Node version 10.
Guide
-
Download the Xcode command line tools by either:
Going to Xcode->Preferences->Downloads
or…
Runxcode-select --install
in the terminal app. -
Download NVM. Before you do that, go open up Terminal. You can spotlight search Terminal and click enter. (Spotlight search is the icon at the top).
Once you go into the terminal app, type in the following to install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
or
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
then run:
export NVM_DIR="$HOME/.nvm"
then
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
then
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
-
Download Node and NPM using NVM. It’s simple, run the following command in your terminal:
nvm install 14.x.x
-
Set your default Node to version 14. You won’t have to manually type
nvm use 14.x.x
every time. Run the following command:
nvm alias default 8.15.1
-
Update NPM.
Run this:
npm install -g npm@6.4.1
Not yet. We are around halfway there.
- Create an account on GitHub. (You can skip this step if you already have an account)
- Download Git here: Download git-2.21.0-intel-universal-mavericks.dmg (git-osx-installer (abandoned))
- After downloading Git, set your username:
git config --global user.name "username"
then confirm it by:
git config --global user.name
- Configure your email address:
git config --global user.email "email@example.com"
Confirm your email:
git config --global user.email
- Clone CodeCombat:
git clone https://github.com/codecombat/codecombat
- After cloning, (It takes a while), type in:
cd codecombat
then
npm install
Note:npm install
might take a few minutes so be patient. - Run
npm run build
- To run your server, type:
cd codecombat
then
npm run proxy
(Optional) Create a new terminal window(Don’t close current one) and type in
cd codecombat
then
npm run webpack -- --watch
Ok fine… Just go to localhost:3000 and see your very own environment in action!
It should look like this:
Those who want to start hacking codecombat, follow this guide: