Error while setting up freeCodeCamp locally on ubuntu. npm run seed error

all prior steps goes well but on doing , sudo npm run seed
This error appears:

i> @freecodecamp/freecodecamp@0.0.1 seed:path-migration /home/zowhair/Documents/web/js/freeCodeCamp/freeCodeCamp1/freeCodeCamp

cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration

internal/modules/cjs/loader.js:1023
throw err;
^

Error: Cannot find module ‘character-entities’
/home/user/Docs/freeCodeCamp/tools/challenge-md-parser/node_modules/parse-entities/index.js

  • /home/user/Docs/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/lib/decode.js, parser.js,
    …/remark-parse/index.js
    …/freeCodeCamp/tools/challenge-md-parser/index.js
    …/freeCodeCamp/curriculum/getChallenges.js
    …/freeCodeCamp/tools/scripts/seed/create-path-migration.js


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed:path-migration: cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed:path-migration 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! /root/.npm/_logs/2020-07-05T08_51_37_386Z-debug.log
(node:15777) Warning: Accessing non-existent property ‘count’ of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:15777) Warning: Accessing non-existent property ‘findOne’ of module exports inside circular dependency
(node:15777) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:15777) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
(node:15777) 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.
fcc:tools:seedLocalAuthUser Connected successfully to mongo +0ms
ERROR: “seed:path-migration” exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed: npm-run-all -p seed:*
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed 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! /root/.npm/_logs/2020-07-05T08_51_37_436Z-debug.log
zowhair@zowhair:~/Documents/web/js/freeCodeCamp/freeCodeCamp1/free

Make sure your mongodb is up and running and put db-url in your .env file:
MONGOHQ_URL=

1 Like

Hello there,

It could be that the repo did not download fully. You may need to run git fetch upstream first.

1 Like

Its already set, MONGOHQ_URL=‘mongodb://localhost:27017/freecodecamp’

Done this , but after that on doing :
now on running
npm run seed

following error occurs

@freecodecamp/freecodecamp@0.0.1 seed /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp
npm-run-all -p seed:*

@freecodecamp/freecodecamp@0.0.1 seed:auth-user /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp
cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser

@freecodecamp/freecodecamp@0.0.1 seed:path-migration /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp
cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration

(node:9064) Warning: Accessing non-existent property ‘count’ of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:9064) Warning: Accessing non-existent property ‘findOne’ of module exports inside circular dependency
(node:9064) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:9064) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
(node:9064) 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.
Oh noes!! Error seeding local auth user.
MongoNetworkError: failed to connect to server [localhost:27017] on first connect [Error: connect ECONNREFUSED 127.0.0.1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16) {
name: ‘MongoNetworkError’,
[Symbol(mongoErrorContextSymbol)]: {}
}]
at Pool. (/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/topologies/server.js:438:11)
at Pool.emit (events.js:315:20)
at /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/connection/pool.js:561:14
at /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/connection/pool.js:994:11
at /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/connection/connect.js:31:7
at callback (/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/connection/connect.js:264:5)
at Socket. (/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/node_modules/mongodb/lib/core/connection/connect.js:294:7)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:100:8) {
[Symbol(mongoErrorContextSymbol)]: {}
}
internal/modules/cjs/loader.js:1023
throw err;
^

Error: Cannot find module ‘character-entities’
Require stack:

  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/parse-entities/index.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/lib/decode.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/lib/parser.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/index.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/index.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/curriculum/getChallenges.js
  • /home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/create-path-migration.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/parse-entities/index.js:3:25)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions…js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/parse-entities/index.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/lib/decode.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/lib/parser.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/node_modules/remark-parse/index.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/challenge-md-parser/index.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/curriculum/getChallenges.js’,
    ‘/home/user/freeCodeCamp/freeCodeCamp1/freeCodeCamp/tools/scripts/seed/create-path-migration.js’
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @freecodecamp/freecodecamp@0.0.1 seed:auth-user: cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed:auth-user script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! @freecodecamp/freecodecamp@0.0.1 seed:path-migration: cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed:path-migration 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! /user/.npm/_logs/2020-07-05T05_33_10_019Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR! /user/.npm/_logs/2020-07-05T05_33_10_028Z-debug.log
ERROR: “seed:auth-user” exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed: npm-run-all -p seed:*
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed 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! /user/.npm/_logs/2020-07-05T05_33_10_069Z-debug.log

now upon running : sudo run seed
This error occurs ,

(node:10506) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:10506) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
(node:10506) 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.
fcc:tools:seedLocalAuthUser Connected successfully to mongo +0ms
fcc:tools:seedLocalAuthUser local auth user seed complete +8ms
internal/modules/cjs/loader.js:1023
throw err;
^

Error: Cannot find module ‘character-entities’
Require stack:

I have installed mongodb 3.6 and using ubuntu 20.04, node -v: 14.2.0, npm -v: 6.14
I am on this step: sudo npm run seed

upon running this command I am getting this error:

@freecodecamp/freecodecamp@0.0.1 seed:path-migration /home/zowhair/Documents/web/js/freeCodeCamp/freeCodeCamp1/freeCodeCamp
cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration

internal/modules/cjs/loader.js:1023
throw err;
^

Error: Cannot find module ‘character-entities’
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed:path-migration: cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed:path-migration 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! /root/.npm/_logs/2020-07-05T08_51_37_386Z-debug.log
(node:15777) Warning: Accessing non-existent property ‘count’ of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)
(node:15777) Warning: Accessing non-existent property ‘findOne’ of module exports inside circular dependency
(node:15777) Warning: Accessing non-existent property ‘remove’ of module exports inside circular dependency
(node:15777) Warning: Accessing non-existent property ‘updateOne’ of module exports inside circular dependency
(node:15777) 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.
fcc:tools:seedLocalAuthUser Connected successfully to mongo +0ms
ERROR: “seed:path-migration” exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed: npm-run-all -p seed:*
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed 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! /root/.npm/_logs/2020-07-05T08_51_37_436Z-debug.log

Hello again.

I cannot tell exactly why you are getting those errors, but here are some tips:

  1. There should be no need to sudo anything for the fCC setup
  2. I recommend you actually watch the ouput when you run both git fetch upstream (Make sure there are no errors before continuing), and npm run ci (again, make sure there are no errors before continuing).
  3. When you get any errors that say: Cannot find... it likely means there was an error during npm ci. Run it again.
  4. Personally, I use Ubuntu 20.04 and Node 14.2.0, and everything usually works for both my machine running Linux, and the other WSL. However, Node 12 is the recommended version that is expected to work with the setup of fCC.
  5. Many issues I found came from me not having a SSH connection to GitHub.

Hope this helps

Hi, Thanks for giving with me

Its ssh now , and again done fetch uppstream multipe times but the error is still there .
Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
fcc:tools:seedLocalAuthUser Connected successfully to mongo +0ms
fcc:tools:seedLocalAuthUser local auth user seed complete +7ms
internal/modules/cjs/loader.js:1023
throw err;
^

Error: Cannot find module ‘character-entities’
npm ERR!
npm ERR! Failed at the @freecodecamp/freecodecamp@0.0.1 seed:path-migration script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Are you getting any helpful information when running npm ci? Does there appear to be any related errors coming up?

no error there

lerna notice cli v3.22.0
lerna info versioning independent
lerna info ci enabled
lerna info Bootstrapping 10 packages
lerna info Symlinking packages and binaries
lerna success Bootstrapped 10 packages
added 1813 packages in 14.028s

internal/modules/cjs/loader.js:1023
throw err;
^
,cannot find module ‘character-entities’

on running npm run seed

Can you check for the character-entities package in the node_modules folders?

tools\challenge-md-parser\node_modules\character-entities
client\node_modules\character-entities

If it is missing, or even if not, try running npm i from inside the two subfolders (tools and client).

Both have character-entities,
This folder : tools\challenge-md-parser\node_modules\character-entities
has a blank package.json file
While this : client\node_modules\character-entities folder has 4 files : index.json, license, package.json and readme.md

Also i ran npm i inside tools folder but still package.json in character-entities is blank

It also takes so much time for me but repeated those step several times and also clone the repo two times and also did upstream

if it really doesn’t work, my suggestion is to use the GitPod environment, meanwhile you try to figure out how to fix your local one

1 Like

It shouldn’t be empty.

Can you try deleting the node_modules folder and running npm i again from inside the tools\challenge-md-parser folder?

1 Like

Woww…Coool…Thanks
I did that it results success in npm run seed, but on exection of npm run develop there was an error, Then I ran: npm run clean and install all packages again using : npm ci then, all goes well.

Thanks For help Dear :heart: :heart_decoration: :heart: