👨‍💻 HOW TO: Run Steemit Condenser WITHOUT Docker on Windows

in Steem Dev5 months ago (edited)

Untitled-2.png
Separator-code.png

How's that for a mouthful of a title?

Since I've decided to start working on condenser (which is just a fancy name for the steemit.com front-end), I've struggled to find a way to develop "on-the-fly" - i.e. without having to build everything into Docker after each change, no matter how minor.

One solution, is to mount your local files within a Docker volume but no matter what I did, I couldn't get this working (even though a standard Docker build worked fine). All I wanted to do was make a change and view it quickly.

So... this "tutorial" will hopefully guide you on how to run steemit.com on your localhost in such a way that you can make and see changes quickly.

Separator-code.png

Assumptions

First off, I assume that you have Visual Studio Code installed. The chances are that if you don't, then I can't help you!

I'll also assume that you opened this post because you've done some coding before.

Separator-code.png

Where to Start

The condenser GitHub README file has some instructions on how to get things running... but I encountered at least half a dozen errors along the way so let's go step-by-step and although I probably can't recreate all of the errors again, I can try to summarise what they were and how I fixed them.

If you encounter a different error, then please comment and if I've come across it before, I'll update this article accordingly. So let's go.

Separator-code.png

1. Install NodeJS (with Packet Manager)

Go to https://nodejs.org/en/download/ and follow the install instructions. For me, it was the "Windows Installer" .msi file.

Separator-code.png

2. Install NVM (Node Version Manager)

Go to this site - https://github.com/coreybutler/nvm-windows/releases - and run the nvm-setup.exe file. This will detect the versions of NodeJS that you already have installed (if any).

Once done, open PowerShell and type:

nvm list

This will list all of the versions of NodeJS that you've got installed.

image.png
Separator-code.png

3. Select The Correct Version

As you can see, I have 3 version installed.

20.11.0 is currently the latest version
10.24.1 is the one currently in use
8.7.0 is the version recommended in Condenser's README file.

NodeJS will install the latest version if you install it (which you can install it by running: nvm install latest)

Which for me, installed 21.6.0. Things move quickly in Node world.

If you run condenser with the the latest version of NodeJS, you'll get the following error when you build it:

error ...PATH...\node_modules\node-sass: command failed.

If you follow the version in the README file, you get a different error later along the line:

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10". Got "8.7.0"

Which is why you need node version 10. You'll see in the DockerFile: "FROM node:10.0" so I just installed version 10:

nvm install 10.0

You then need to set it as the version you want to use:

nvm use 10.0

nvm list should then look like this:

image.png
Separator-code.png

4. Install GitHub

Go here - https://desktop.github.com/ - install it and setup / login to your account. Hopefully this is the easy bit.

Separator-code.png

5. Configure GitHub to work with Visual Studio Code and Windows

This was a fun challenge which was solved via the top answer to this Stackoverflow question...

https://stackoverflow.com/questions/26620312/git-installing-git-in-path-with-github-client-for-windows

Although mine was slightly different...

First, find your git.exe - this is NOT GitDesktop.exe (or similar). Mine was located here:
C:/Users/the_g/AppData/Local/GitHubDesktop/app-3.3.8/resources/app/git/cmd/git.exe

You might need to check the version number that's running (my GitHub folder had 2 versions installed) which you can find by opening GitHub Desktop and clicking "Help > About GitHub Desktop" in the menu.

Once you've got your version number, open Visual Studio Code (VSC) and select "File > Preferences > Settings" and search for "git". Scroll down to where you see "Default Clone Directory" and select "Edit in settings.json".

Edit this file and add a line:

"git.path": "C:/Users/the_g/AppData/Local/GitHubDesktop/app-3.3.8/resources/app/git/cmd/git.exe",

Remembering to edit the file path to make it yours and not mine. Restart VSC - if there's a problem, you'll get one of those error icons in the corner which says "Git not found. Install it or configure it using the "git.path" setting.". If it's all good, then you won't.

The next bit, is to edit the PATH variable in your windows system which I'll explain via copy and paste:

Navigate to the Environmental Variables Editor (instructions) and find the Path variable in the “System Variables” section. Click Edit… and paste the URL of Git to the end of that string. Save! It might be easier to pull this into Notepad to do the edit, just make sure you put one semicolon before you paste in the URL. If it doesn't work it’s probably because this path got messed up either with a space in there somewhere (should be no spaces around the semicolon) or a semicolon at the end (semicolons should only separate URLs, no semicolon at beginning or end of string).

It should look something like this:

image.png

Go back to your PowerShell to check it's all looking ok by testing:

git --version

image.png

Winner.

Separator-code.png

6. Download the Source Code

With Node and GitHub set up. It's time to follow the instructions in the README file...

In Powershell, navigate to the directory where you want your codebase to be installed and type:

git clone https://github.com/steemit/condenser

You'll need to create a "tmp" folder within the download so type:

cd condenser
then
mkdir tmp

Separator-code.png

7. Time to Run the Code (nearly)

Next, you need to install "yarn" so type:
npm install -g yarn

and then babel:

yarn global add babel-cli

and finally, all of the package dependencies:

yarn install --frozen-lockfile

This is where you'll run into problems if you're not running the correct version of NodeJS.

Now you should be good to go so let's launch the code:

yarn run start

Oh no! An error... ""NODE_ENV" is not recognized as an internal or external command, operable command or batch file"...

Well that's because we're on Windows... a simple fix by installing another package:

npm install -g win-node-env

Try again and wait for everything to load...

Navigate to https://localhost:8080 and you're there...

Note: "yarn run build" or "yarn run production" won't work on Windows without editing parts of the codebase.

Untitled-2.png
Separator-code.png

Conclusion

Hopefully this works for you. If it saves you the hours that I spent troubleshooting and getting things working, then it's more hours for you to contribute towards understanding and improving steemit.

There's a good chance that I've missed some of the errors that I encountered - there were plenty, so apologies if I did. Please let me know in the comments - even if you stumble across this post in 2027 then I might be able to help. At very least, you'll have a sympathetic ear.



Separator-code.png

the-gorilla's Alternative Steemit Interface

In case you didn't know, I've created an interface to help you find content that you're interested in more easily.

Posts by voting bot users, abusers and spam tags are hidden and you can search by multiple tags - allowing you to find the content that you're interested in more easily.

👉 Launch Alternative Steemit Interface 👈




Separator-tools.png

the-gorilla's Club Status Tool

I've also created a tool to help users review their club status - showing them where their power's coming from, how much they're powering up, transferring out and who they share a wallet with amongst other things.

Please use it wisely.

👉 Launch Club Status Tool 👈

Footer-Bottom.png

Sort:  

hmm... why am I not a programmer...?))

 5 months ago 

You probably enjoy the outdoors too much 🤣

This post has been featured in the latest edition of Steem News...

 5 months ago 

Thank you for all of the inclusions 👍

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.028
BTC 64233.18
ETH 3491.62
USDT 1.00
SBD 2.54