question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`seed` script fails to run in Windows

See original GitHub issue

Describe the bug

The npm run seed script used for seeding sample data to the DB fails to run. When the seed script is run (after following all the previous steps in the docs), this is the output -

npm run seed

> @freecodecamp/freecodecamp@0.0.1 seed D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp
> npm-run-all -p seed:*


> @freecodecamp/freecodecamp@0.0.1 seed:auth-user D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp
> cross-env DEBUG=fcc:* node ./tools/scripts/seed/seedAuthUser


> @freecodecamp/freecodecamp@0.0.1 seed:path-migration D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp
> cross-env DEBUG=fcc:* node ./tools/scripts/seed/create-path-migration

(node:2848) 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 +17ms

Then, errors start to get logged for each individual markdown file -


(node:6772) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, 
or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3180)
(node:6772) UnhandledPromiseRejectionWarning: Error: Malformed challenge path, D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\challenges\english\10-coding-interview-prep\project-euler\problem-467-superinteger.english.md unable to parse.
    at getEnglishPath (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\getChallenges.js:187:11)
    at createChallenge (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\getChallenges.js:134:29)
    at buildCurriculum (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\getChallenges.js:89:27)
    at EventEmitter.<anonymous> (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\getChallenges.js:47:9)
    at EventEmitter.emit (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\node_modules\eventemitter3\index.js:181:35)
    at Object.filter (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\node_modules\readdirp-walk\readdirp.js:72:15)
    at processFilter (D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\node_modules\walk-filtered\index.js:23:91)
    at D:\xampp\htdocs\gitcontributions\deep\freeCodeCamp\curriculum\node_modules\walk-filtered\index.js:34:5
    at FSReqCallback.oncomplete (fs.js:169:5)

This looks like the DB is working fine cause it successfully seeds user data to the DB.

image

To Reproduce Steps to reproduce the behavior:

  1. Clone forked repo on Windows
  2. Run cp sample.env .env
  3. Run npm ci
  4. Run npm run seed
  5. See error

Expected behavior

Expected to seed data to the DB. (It seeded data previously to my DB but I recently re-installed Windows so I have a fresh DB installed)

Desktop (please complete the following information):

  • OS: Windows 10 (v2004) (64 Bit)
  • Node Version: v12.18.3

Additional context

I have previously ran fCC locally (last ran it 3 weeks ago) but can’t run it now after a clean install of Windows because seeding fails.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ojeytonwilliamscommented, Aug 22, 2020

Thanks for the report @Twaha-Rahman and sorry for breaking things for Windows. I think you’re right @Sky020, while I tried to account for the paths, clearly I didn’t manage it.

I think we could do with some Windows testing in our CI so we can better support contributors using it.

0reactions
ShaunSHamiltoncommented, Aug 22, 2020

@RandellDawson That looks much better. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The seeding operation failed. Error: An error occurred while ...
I have recently deployed Exchange 2016 DAG, When I try to add database copies am getting this error, Please suggest. Thanks,.
Read more >
D2 cluster up --seed (failure on windows) - DHIS2 Community
Hi all, Attempting to seed a dev database on windows using the seed command. Initially I was getting a “'.' is not recognized...
Read more >
I've been trying to run my seed script in prisma with nextJs and ...
It seems this is an issue with ts-node package. A workaround is to avoid ts-node altogether and create an NPM script to compile...
Read more >
What is seed script in VMware AirWatch console and why you ...
... would release a seed script that you can run against your AirWatch database. ... Otherwise, you will not see this feature at...
Read more >
Seed User Guide - GitHub Pages
If a ModuleNotFound error occurs, see the Python ModuleNotFound Errors section. 5.2.2. Running in Docker. First, create a script called ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found