`seed` script fails to run in Windows
See original GitHub issueDescribe 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.
To Reproduce Steps to reproduce the behavior:
- Clone forked repo on Windows
- Run
cp sample.env .env
- Run
npm ci
- Run
npm run seed
- 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:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
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.
@RandellDawson That looks much better. Thank you.