Running free code camp tutorials offline

Continuing the discussion from Free code camp honesty policy:

Hi, i’m running into some issues during this process:

  1. There’s a lot of errors on the terminal, for example:
> If you're more experienced with GraphQL, you can also export GraphQL
> fragments from components and compose the fragments in the Page component
> query and pass data down into the child component — https://graphql.org/learn/queries/#fragments
> success write out requires - 0.538s
> [                            ]   0.001 s 0/3 0% run static queries
> success run static queries - 0.808s - 3/3 3.71/s
> [                            ]   0.003 s 0/3 0% run page queries
> success run page queries - 0.474s - 3/3 6.33/s
> ⠸ Building development bundle
>   fcc:models:user setting up user hooks +6s
> (node:10568) [MONGODB DRIVER] Warning: Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.
> (Use `node --trace-warnings ...` to show where the warning was created)
> (node:10568) [MONGODB DRIVER] Warning: 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.
>   fcc:server freeCodeCamp server listening on port 3000 in development +7s
>   fcc:server connecting to db at mongodb://localhost:27017/freecodecamp +2ms
>   fcc:boot:donate Donation disabled in development unless ALL test keys are provided +2ms
> Connection fails: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkTimeoutError: connection timed out
>     at connectionFailureError (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:342:14)
>     at Socket.<anonymous> (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:310:16)
>     at Object.onceWrapper (node:events:509:28)
>     at Socket.emit (node:events:390:28)
>     at Socket.emit (node:domain:475:12)
>     at Socket._onTimeout (node:net:501:8)
>     at listOnTimeout (node:internal/timers:557:17)
>     at processTimers (node:internal/timers:500:7)]
> It will be retried for the next request.
> MongoNetworkError: Error caught seeding the cache: failed to connect to server [localhost:27017] on first connect [MongoNetworkTimeoutError: connection timed out
>     at connectionFailureError (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:342:14)
>     at Socket.<anonymous> (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:310:16)
>     at Object.onceWrapper (node:events:509:28)
>     at Socket.emit (node:events:390:28)
>     at Socket.emit (node:domain:475:12)
>     at Socket._onTimeout (node:net:501:8)
>     at listOnTimeout (node:internal/timers:557:17)
>     at processTimers (node:internal/timers:500:7)]
>     at Pool.<anonymous> (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\topologies\server.js:438:11)
>     at Pool.emit (node:events:390:28)
>     at Pool.emit (node:domain:475:12)
>     at C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\pool.js:562:14
>     at C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\pool.js:995:11
>     at C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:32:7
>     at callback (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:280:5)
>     at Socket.<anonymous> (C:\Users\SAHEED LAWASON\Documents\fcc\freeCodeCamp\api-server\node_modules\mongodb\lib\core\connection\connect.js:310:7)
>     at Object.onceWrapper (node:events:509:28)
>     at Socket.emit (node:events:390:28)
>     at Socket.emit (node:domain:475:12)
>     at Socket._onTimeout (node:net:501:8)
>     at listOnTimeout (node:internal/timers:557:17)
>     at processTimers (node:internal/timers:500:7)
> ⠏ Building development bundle
  1. Its been on “Building development bundle” for over 45 mins, is that normal

There is only one error - for the most part, you can ignore the warnings and suggestions.

This is saying the server cannot connect to the database. If you have started the database, then you may need to double check you have not changed any default start locations.

Depends on the hardware you are running it on, but 45min is excessive.


My suggestions:

  1. If you are trying to set fCC up locally, follow the official Contributors Docs. These are up-to-date, and are the recommended way to do so
  2. Develop your client and server in separate terminals:
    Terminal A
npm run develop:server

Terminal B

npm run develop:client

This will help you identify when errors are coming from the client or the server.

Hope this helps