freeCodeCamp local is wsl2 environment

To access freeCodeCamp locally in wsl2 I used the official guide:
https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/how-to-setup-freecodecamp-locally.md

But port http://localhost:8000/ isn’t working yet.

To install pre-requisites for Docker-Build:

  1. Docker Desktop = official Docker desktop for wsl2
  2. node.js / npm = digitiaocean -> how-to-install-node-js-on-ubuntu-20-04

Result of command npm run docker:develop :

`❯ npm run docker:develop

> @freecodecamp/freecodecamp@0.0.1 docker:develop /mnt/c/Users/sanji/Desktop/freeCodeCamp
> docker-compose up client api-server

Creating network "freecodecamp_default" with the default driver
Creating freecodecamp_client_1  ... done
Creating freecodecamp_mailhog_1 ... done
Creating freecodecamp_db_1      ... done
Creating freecodecamp_api-server_1 ... done
Attaching to freecodecamp_client_1, freecodecamp_api-server_1
client_1        |
client_1        | > @freecodecamp/client@1.0.0 predevelop /app/client
client_1        | > npm run prebuild
client_1        |
client_1        |
client_1        | > @freecodecamp/client@1.0.0 prebuild /app/client
client_1        | > echo 'Client workers building...' && npm run build:workers && echo 'Client workers ready.' && node ../tools/scripts/build/ensure-env.js
client_1        |
client_1        | Client workers building...
api-server_1    |
api-server_1    | > @freecodecamp/api-server@0.0.1 develop /app/api-server
api-server_1    | > cross-env DEBUG=fcc* node development-start.js
api-server_1    |
client_1        |
client_1        | > @freecodecamp/client@1.0.0 build:workers /app/client
client_1        | > node --max_old_space_size=7168 node_modules/webpack-cli --env.production --config ./webpack-workers.js && echo
client_1        |
api-server_1    | Thu, 24 Sep 2020 12:41:35 GMT fcc:start:development Webhook client is not configured.
api-server_1    | Thu, 24 Sep 2020 12:41:35 GMT fcc:start:development This can be ignored when not working with webhooks locally.
api-server_1    | Debugger listening on ws://0.0.0.0:9229/dbafa9ae-8baf-41f7-98f6-755765053eba
api-server_1    | For help, see: https://nodejs.org/en/docs/inspector
api-server_1    | Thu, 24 Sep 2020 12:41:37 GMT fcc:server Sentry reporting disabled unless DSN is provided.
api-server_1    | Thu, 24 Sep 2020 12:41:37 GMT fcc:server:datasources using MailHog server on port 1025
api-server_1    | Thu, 24 Sep 2020 12:41:39 GMT fcc:server:utils:about no google applications credentials environmental variable found
api-server_1    | 'GOOGLE_APPLICATION_CREDENTIALS'
api-server_1    | 'activeUser' api will always return 0
api-server_1    | this can safely be ignored during development
api-server_1    | Thu, 24 Sep 2020 12:41:39 GMT fcc:models:user setting up user hooks
api-server_1    | (node:63) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
api-server_1    | Thu, 24 Sep 2020 12:41:40 GMT fcc:server freeCodeCamp server listening on port 3000 in development
api-server_1    | Thu, 24 Sep 2020 12:41:40 GMT fcc:server connecting to db at mongodb://db:27017/freecodecamp
api-server_1    | Thu, 24 Sep 2020 12:41:40 GMT fcc:server db connected
api-server_1    | Thu, 24 Sep 2020 12:41:40 GMT fcc:boot:donate activeDonor count: 0
client_1        | Hash: 828ba06de2bb6350f051
client_1        | Version: webpack 4.43.0
client_1        | Time: 11656ms
client_1        | Built at: 09/24/2020 12:41:47 PM
client_1        |                                                     Asset       Size  Chunks                                Chunk Names
client_1        |                    enzyme-adapter.ae4f464227667d400cd8.js  206 bytes    2, 1  [emitted] [immutable]         enzyme-adapter
client_1        |                enzyme-adapter.ae4f464227667d400cd8.js.map  115 bytes    2, 1  [emitted] [dev]               enzyme-adapter
client_1        |                            enzyme.3001a9fc31bdcc55a59b.js  198 bytes    1, 2  [emitted] [immutable]         enzyme
client_1        |                        enzyme.3001a9fc31bdcc55a59b.js.map  107 bytes    1, 2  [emitted] [dev]               enzyme
client_1        |                      frame-runner.90f69806775712941614.js    754 KiB       3  [emitted]              [big]  frame-runner
client_1        |                  frame-runner.90f69806775712941614.js.map   2.69 MiB       3  [emitted] [dev]               frame-runner
client_1        |                      sass-compile.d88c6c80b3a34ce81a89.js   1.36 KiB       4  [emitted]                     sass-compile
client_1        |                  sass-compile.d88c6c80b3a34ce81a89.js.map   5.89 KiB       4  [emitted] [dev]               sass-compile
client_1        |                                              sass.sync.js   4.39 MiB          [emitted]              [big]
client_1        |                    test-evaluator.68a887b6c08184d5a76a.js    739 KiB    5, 6  [emitted]              [big]  test-evaluator
client_1        |                test-evaluator.68a887b6c08184d5a76a.js.map   2.69 MiB    5, 6  [emitted] [dev]               test-evaluator
client_1        |                      vendors~chai.1aeadc7dc36899f1d5be.js   67.8 KiB       6  [emitted] [immutable]         vendors~chai
client_1        |                  vendors~chai.1aeadc7dc36899f1d5be.js.map    423 KiB       6  [emitted] [dev]               vendors~chai
client_1        |            vendors~enzyme-adapter.dae68af43c6f7e85b676.js    227 KiB       7  [emitted] [immutable]         vendors~enzyme-adapter
client_1        |        vendors~enzyme-adapter.dae68af43c6f7e85b676.js.map    759 KiB       7  [emitted] [dev]               vendors~enzyme-adapter
client_1        |     vendors~enzyme~enzyme-adapter.e370fcaa58d27bfaa25c.js    498 KiB       0  [emitted] [immutable]  [big]  vendors~enzyme~enzyme-adapter
client_1        | vendors~enzyme~enzyme-adapter.e370fcaa58d27bfaa25c.js.map   2.02 MiB       0  [emitted] [dev]               vendors~enzyme~enzyme-adapter
client_1        | Entrypoint frame-runner [big] = frame-runner.90f69806775712941614.js frame-runner.90f69806775712941614.js.map
client_1        | Entrypoint sass-compile = sass-compile.d88c6c80b3a34ce81a89.js sass-compile.d88c6c80b3a34ce81a89.js.map
client_1        | Entrypoint test-evaluator [big] = test-evaluator.68a887b6c08184d5a76a.js test-evaluator.68a887b6c08184d5a76a.js.map
client_1        |  [93] (webpack)/buildin/module.js 497 bytes {3} {5} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [134] (webpack)/buildin/global.js 472 bytes {3} {5} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [216] ./src/utils/curriculum-helpers.js 802 bytes {3} {5} [built]
client_1        | [590] ./src/utils/format.js 203 bytes {5} [built]
client_1        | [615] ./src/client/frame-runner.js 7.21 KiB {3} [built]
client_1        |       ModuleConcatenation bailout: Module uses eval()
client_1        | [619] ./src/client/workers/sass-compile.js 756 bytes {4} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [620] ./src/client/workers/test-evaluator.js 5.9 KiB {5} [built]
client_1        |       ModuleConcatenation bailout: Module uses eval()
client_1        | [714] ./util.inspect (ignored) 15 bytes {1} {2} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [743] readable-stream (ignored) 15 bytes {1} {2} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [752] util (ignored) 15 bytes {1} {2} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        | [753] util (ignored) 15 bytes {1} {2} [built]
client_1        |       ModuleConcatenation bailout: Module is not an ECMAScript module
client_1        |     + 990 hidden modules
client_1        |
client_1        | WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
client_1        | This can impact web performance.
client_1        | Assets:
client_1        |   vendors~enzyme~enzyme-adapter.e370fcaa58d27bfaa25c.js (498 KiB)
client_1        |   frame-runner.90f69806775712941614.js (754 KiB)
client_1        |   test-evaluator.68a887b6c08184d5a76a.js (739 KiB)
client_1        |   sass.sync.js (4.39 MiB)
client_1        |
client_1        | WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
client_1        | Entrypoints:
client_1        |   frame-runner (754 KiB)
client_1        |       frame-runner.90f69806775712941614.js
client_1        |   test-evaluator (739 KiB)
client_1        |       test-evaluator.68a887b6c08184d5a76a.js
client_1        |
client_1        |
client_1        | Client workers ready.
client_1        |
client_1        | > @freecodecamp/client@1.0.0 develop /app/client
client_1        | > node --inspect=0.0.0.0:9228 node_modules/gatsby-cli develop "-H" "0.0.0.0"
client_1        |
client_1        | Debugger listening on ws://0.0.0.0:9228/f9723b08-0728-494c-827e-0ec1d877ec8e
client_1        | For help, see: https://nodejs.org/en/docs/inspector
client_1        | ╔════════════════════════════════════════════════════════════════════════╗
client_1        | ║                                                                        ║
client_1        | ║   Gatsby collects anonymous usage analytics                            ║
client_1        | ║   to help improve Gatsby for all users.                                ║
client_1        | ║                                                                        ║
client_1        | ║   If you'd like to opt-out, you can use `gatsby telemetry --disable`   ║
client_1        | ║   To learn more, checkout https://gatsby.dev/telemetry                 ║
client_1        | ║                                                                        ║
client_1        | ╚════════════════════════════════════════════════════════════════════════╝
client_1        | success open and validate gatsby-configs - 0.496s
client_1        | success load plugins - 1.036s
client_1        | success onPreInit - 0.003s
client_1        | success initialize cache - 0.119s
client_1        | success copy gatsby files - 0.782s
client_1        | success onPreBootstrap - 0.034s
client_1        | success createSchemaCustomization - 0.044s
api-server_1    | Thu, 24 Sep 2020 12:41:56 GMT fcc:boot:donate Donation disabled in development unless ALL test keys are provided
api-server_1    |
api-server_1    | Error: Access token is required for this request
api-server_1    | Is authenticated user: false
api-server_1    | Headers: {
api-server_1    |   "host": "localhost:3000",
api-server_1    |   "connection": "keep-alive",
api-server_1    |   "upgrade-insecure-requests": "1",
api-server_1    |   "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
api-server_1    |   "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
api-server_1    |   "sec-fetch-site": "none",
api-server_1    |   "sec-fetch-mode": "navigate",
api-server_1    |   "sec-fetch-user": "?1",
api-server_1    |   "sec-fetch-dest": "document",
api-server_1    |   "accept-encoding": "gzip, deflate, br",
api-server_1    |   "accept-language": "en-US,en;q=0.9,ne;q=0.8,fr;q=0.7",
api-server_1    |   "cookie": "connect.sid=s%3ABmXdME14OnV3xKTeBaDcViW0TsTsVzGh.R0lGOAMUGeuTdRYoO4aOUewTBM7MQNi7HmDbZx0XTn8"
api-server_1    | }
api-server_1    | Original request: undefined /
api-server_1    | Stack: Error: Access token is required for this request
api-server_1    |     at requestAuthorisation (/app/api-server/server/middlewares/request-authorization.js:61:11)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at cookieParser (/app/api-server/node_modules/cookie-parser/index.js:71:5)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at /app/api-server/server/middlewares/add-return-to.js:30:14
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |
api-server_1    | // raw
api-server_1    | {}
api-server_1    |
api-server_1    |
api-server_1    | 2020-09-24T12:41:56.627Z 302 GET 349.586 ms - /
api-server_1    |
api-server_1    | Error: Access token is required for this request
api-server_1    | Is authenticated user: false
api-server_1    | Headers: {
api-server_1    |   "host": "localhost:3000",
api-server_1    |   "connection": "keep-alive",
api-server_1    |   "upgrade-insecure-requests": "1",
api-server_1    |   "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
api-server_1    |   "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
api-server_1    |   "sec-fetch-site": "none",
api-server_1    |   "sec-fetch-mode": "navigate",
api-server_1    |   "sec-fetch-user": "?1",
api-server_1    |   "sec-fetch-dest": "document",
api-server_1    |   "accept-encoding": "gzip, deflate, br",
api-server_1    |   "accept-language": "en-US,en;q=0.9,ne;q=0.8,fr;q=0.7",
api-server_1    |   "cookie": "connect.sid=s%3ABmXdME14OnV3xKTeBaDcViW0TsTsVzGh.R0lGOAMUGeuTdRYoO4aOUewTBM7MQNi7HmDbZx0XTn8"
api-server_1    | }
api-server_1    | Original request: undefined /
api-server_1    | Stack: Error: Access token is required for this request
api-server_1    |     at requestAuthorisation (/app/api-server/server/middlewares/request-authorization.js:61:11)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at cookieParser (/app/api-server/node_modules/cookie-parser/index.js:71:5)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at /app/api-server/server/middlewares/add-return-to.js:30:14
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |
api-server_1    | // raw
api-server_1    | {}
api-server_1    |
api-server_1    |
api-server_1    | 2020-09-24T12:42:23.367Z 302 GET 6.762 ms - /
client_1        | success source and transform nodes - 136.878s
client_1        | success building schema - 0.688s
client_1        | info Stripe public key missing or invalid. Required for donations.
client_1        | warn code block or inline code language not specified in markdown. applying generic code block
client_1        | success createPages - 4.242s
api-server_1    |
api-server_1    | Error: Access token is required for this request
api-server_1    | Is authenticated user: false
api-server_1    | Headers: {
api-server_1    |   "host": "localhost:3000",
api-server_1    |   "connection": "keep-alive",
api-server_1    |   "upgrade-insecure-requests": "1",
api-server_1    |   "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
api-server_1    |   "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
api-server_1    |   "sec-fetch-site": "none",
api-server_1    |   "sec-fetch-mode": "navigate",
api-server_1    |   "sec-fetch-user": "?1",
api-server_1    |   "sec-fetch-dest": "document",
api-server_1    |   "accept-encoding": "gzip, deflate, br",
api-server_1    |   "accept-language": "en-US,en;q=0.9,ne;q=0.8,fr;q=0.7",
api-server_1    |   "cookie": "connect.sid=s%3ABmXdME14OnV3xKTeBaDcViW0TsTsVzGh.R0lGOAMUGeuTdRYoO4aOUewTBM7MQNi7HmDbZx0XTn8"
api-server_1    | }
api-server_1    | Original request: undefined /
api-server_1    | Stack: Error: Access token is required for this request
api-server_1    |     at requestAuthorisation (/app/api-server/server/middlewares/request-authorization.js:61:11)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at cookieParser (/app/api-server/node_modules/cookie-parser/index.js:71:5)
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |     at Function.process_params (/app/api-server/node_modules/express/lib/router/index.js:335:12)
api-server_1    |     at next (/app/api-server/node_modules/express/lib/router/index.js:275:10)
api-server_1    |     at /app/api-server/server/middlewares/add-return-to.js:30:14
api-server_1    |     at Layer.handle [as handle_request] (/app/api-server/node_modules/express/lib/router/layer.js:95:5)
api-server_1    |     at trim_prefix (/app/api-server/node_modules/express/lib/router/index.js:317:13)
api-server_1    |     at /app/api-server/node_modules/express/lib/router/index.js:284:7
api-server_1    |
api-server_1    | // raw
api-server_1    | {}
api-server_1    |
api-server_1    |
api-server_1    | 2020-09-24T12:44:22.572Z 302 GET 11.288 ms - /
client_1        | success createPagesStatefully - 59.127s
client_1        | success onPreExtractQueries - 0.002s
client_1        | success update schema - 0.771s
client_1        | success extract queries from components - 20.900s
client_1        | success write out requires - 5.270s
client_1        | success write out redirect data - 2.355s
client_1        | success Build manifest and related icons - 2.546s
client_1        | success onPostBootstrap - 2.559s
client_1        | ⠀
client_1        | info bootstrap finished - 239.049 s
client_1        | ⠀
client_1        |
client_1        |
client_1        | 1724 pages                              IN_PROGRESS
client_1        | @freecodecamp/client
api-server_1    | Thu, 24 Sep 2020 12:46:40 GMT fcc:boot:donate activeDonor count: 0
api-server_1    | Thu, 24 Sep 2020 12:51:40 GMT fcc:boot:donate activeDonor count: 0
api-server_1    | Thu, 24 Sep 2020 12:56:40 GMT fcc:boot:donate activeDonor count: 0`

/mnt/c/Users/sanji/Desktop/freeCodeCamp is where freeCodeCamp is located not in Ubuntu $Home folder.

Error: Access token is required for this request
Is authenticated user: false
Q. Is the above statmement becuase of Docker or GitHub SSH key passphrase or something else ?

----------------Solved-------------------------

Solution:
=> I copied freeCodeCamp repo from /mnt/c/Users/sanji/Desktop/ to wsl2/Ubuntu $HOME folder. It worked.

the last thing I read on the repository was that the docker build is being dismissed because it’s a mess. I hope you find someone that can help you!

Welcome, sanjibpoon.

Ditto to what @ilenia mentioned.

However, here are the official docs for WSL: https://contribute.freecodecamp.org/#/how-to-setup-wsl

This is where we expect you to view the most up-to-date docs. (Some things have changed with WSL2, though. So, I hope most of the errors will not come up)

Hope this helps

Yep - our contributing docs could use some more love. I have setup WSL2 and using it as my daily driver.

Here is the shameless plug to how I got it going:

If someone is interested in updating the docs, that would be awesome.

Are we talking removing the mention of how to set up using Docker, or updating the Docker setup instructions?

I am thinking we should remove the docker setup from the contributing docs, and recommend the GitPod as default for anyone wishing to make a quick no-frills setup.

For everything else I see that we should be closer to the Unix world. I will keep evaluating the WSL2 Setup a bit more and that should be enough to complete the triology macOS, Ubuntu and Windows a bit more.