I don't understand how to set up offline freecodecamp

From the how-to-setup-freecodecamp-locally.md guide in github

Am I supposed to do the Installing prerequisites and Configuring dependencies parts first and then work my way down from Fork the repository on GitHub?

Or should I do Installing prerequisites without Configuring dependencies and then do the rest?

Thanks in advance guys

You mean setup locally right ? Follow the guide with docker, its newer and works better than the old guide

1 Like

So I started the Docker guide but I’m stuck in the Installing dependencies part and have no idea what to do now.

Where it says: Then you have to bootstrap the docker images just one time to prepare them for running.

npm run docker:init
npm run docker:install
npm run docker:seed

Am I supposed to type this in a cmd in a specific folder or using the docker program itself?

You are supposed to type it in your command line interface in the root folder of the project you pulled from git. If you are on a linux type system that would be bash, or (if like me) you are on windows then PowerShell would work.
Did you install Docker already ? What OS do you have ?

I already installed Docker. My OS is Windows 10. I was able to run it and it seems to be going fine but it’s been stuck for like an hour on:
[ .] \ install dependencies: verb installed leaf @freecodecamp/client

I have Windows Professional.

do you have a firewall ? I also have Windows 10 Pro , but I had to disable the firewall for docker to access the ports and for it to work

I tried disabling the firewall but I still some errors or warnings.

When running npm run docker:install this appears:

npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @freecodecamp/freecodecamp@0.0.1 No repository field.
npm WARN @freecodecamp/freecodecamp@0.0.1 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: nan@2.11.1 (node_modules/nan):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: request to https://registry.npmjs.org/nan/-/nan-2.11.1.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org registry.npmjs.org:443

And when I try to run npm run docker:develop:

Starting freecodecamp_client_1 ... error

ERROR: for freecodecamp_client_1  Cannot start service client: driver failed programming external connectivity on endpoint freecodecamp_client_1 (a11613fe23d154b86af7656c4469bef3af576aede25e067356080ffdcac5a3b6): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9228:tcp:172.18.0.4:9228: input/output error

ERROR: for client  Cannot start service client: driver failed programming external connectivity on endpoint freecodecamp_client_1 (a11613fe23d154b86af7656c4469bef3af576aede25e067356080ffdcac5a3b6): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9228:tcp:172.18.0.4:9228: input/output error
ERROR: Encountered errors while bringing up the project.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 docker:develop: `docker-compose up client api-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 docker:develop script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\A\AppData\Roaming\npm-cache\_logs\2019-05-07T05_54_42_490Z-debug.log

Hard to troubleshoot this from here, however, if you did notice a change in the errors after disabling the firewall, likely that is what is causing you the problem and not the source, I would , delete the entire folder , do a fresh new pull , disable the firewall, run docker and then follow all the instructions again, I remember having to do this a couple of times. Also you may get more direct assistance here: https://gitter.im/FreeCodeCamp/Contributors

Well I tried a second time without running npm ci --ignore-scripts and got different warnings but the page opens and all is working great, won’t mess with making changes to your clone part though since it looks too complicated but I can just re-do it when I have internet access again so I’m good with this. Thanks a lot for the help!

yeah firewall seems to be an issue with Windows and setting up docker, by any chance are you using Norton 360 smart fire wall ?

I’m not, just using the Windows default one, the first time I did it it did ask permission but I think it just ignored it and it did nothing

Can confirm that this has something to do with the firewall (at least for me). I’m on Ubuntu 19.04 and after running sudo npm run docker:install (yes, I had to use sudo) I also got stuck at
[ .] \ install dependencies: verb installed leaf @freecodecamp/client

When I disabled my firewall with sudo ufw disable the problem was solved.