Offline freecodecamp issue : pm ERR! @freecodecamp/freecodecamp@0.0.1 seed: `cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser

hello everybody
so i am trying to setup freecodecamp locally but i am facing this err while i am executing the command " npm run seed".

i am using :
- ubuntu 20.04 .
- mongodb v4.4.3.
- nodeJs v14.15.4 .
- npm v6.14.10.
more info :

  • what i get when i write " npm run seed" and press enter :
> @freecodecamp/freecodecamp@0.0.1 seed /media/chiheb/FCB63E53B63E0F20/freecodecampdirectory/freeCodeCamp
> cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser

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

Error: Cannot find module '/media/chiheb/FCB63E53B63E0F20/freecodecampdirectory/freeCodeCamp/tools/scripts/seed/seedAuthUser'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @freecodecamp/freecodecamp@0.0.1 seed: `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 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!     /home/chiheb/.npm/_logs/2021-02-05T11_25_41_006Z-debug.log

does anybody know how i can fix this?

Welcome, chiheb.

Which directory are you in, when you run npm run seed? Also, are you sure you have the latest HEAD off of upstream/main?

i was in

freecodecampdirectory/freeCodeCamp$ npm run seed

which is the directory i got from forking and cloning the repo
i don’t know if i have the last head … it’s my first time i use git/github i just followed the instructions on this page

Are you able to locate the file: tools/scripts/seed/seedAuthUser?


Just to let you know, this document is hosted here: Introduction (freecodecamp.org) (It is much nicer to navigate, and read)


Also, what setup are you running? (OS, etc)

1 -yeah i can locate that file ( i didn’t understand what’s in it though)
2- i’m using those :

That is fine. I just cannot see why node cannot locate it.

Final thought: Change the package.json script in the root directory to be:

"seed": "cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser.js",

All I did was add .js to the end. I do not expect this to work, but why not


Sorry about that, I completely missed this.

now it’s just the same error with the “.js” at the end ( sorry for not responding all that time : connexion issues, hence why i wanna get the website offline)

A lot has changed, in the last few days, on the code base. Have you recently run :

  • git fetch upstream
  • git checkout main
  • git reset --hard upstream/main
  • Then try the develop steps again (including cp sample.env .env)

If this does not work, then I am out of my depth, and cannot think of why not.