Quote Keeper: Model Layer

I’m working on the Quote Keeper: Model Layer project as part of the Web Development Skill Path

It works alright, up until I get to the mongoose installation step with npm install mongoose (step 5).
From that point on I get a consistent error message:

> calculator-js@0.0.0 test /home/ccuser/workspace/tdd-model-project
> bin/mocha-test && PORT=8001 bin/wdio-test

/home/ccuser/workspace/tdd-model-project/node_modules/mongodb/lib/cursor/abstract_cursor.js:60
            ...(0, bson_1.pluckBSONSerializeOptions)(options)
            ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/node_modules/mongodb/lib/index.js:5:27)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js:8:16)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js:7:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/node_modules/mongoose/lib/index.js:7:25)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/node_modules/mongoose/index.js:9:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/database.js:3:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ccuser/workspace/tdd-model-project/test/models/quote-test.js:3:42)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /home/ccuser/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (native)
    at Mocha.loadFiles (/home/ccuser/node_modules/mocha/lib/mocha.js:217:14)
    at Mocha.run (/home/ccuser/node_modules/mocha/lib/mocha.js:469:10)
    at Object.<anonymous> (/home/ccuser/node_modules/mocha/bin/_mocha:404:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3
npm ERR! Test failed.  See above for more details.

I’m Really at a loss here - I tried copying the code from the hints, but I get the same error.
Reading the error message tells me it’s a clearly not a problem with my code.
I really want to finish this project, and not just skip it - It seems like I can learn from whatever is going on here…

1 Like

I am having the same issue.

To troubleshoot, I have tried:

  • Resetting the course and doing it again (Several times).
  • Copying text from the help dropdowns.
  • Following the attached video.

However, every time it still breaks at step 5 - npm install mongoose and uncomment database.js without fail.

After doing some digging, it seems like the issue is occurring in the MongoDB npm package under the cursor director. According to the npm site, MongoDB was updated 9 days ago and this may be a bug related to that.

I will let you know if I am able to find anything out, but at this point, I am just going to wait a week, reset the course, and see if anything changes.

Really unfortunate as it is the last project of this career path… :man_facepalming:

1 Like

Alrighty, so I ran into this today and was pretty frustrated. Pretty much I noticed that you don’t actually need to call “npm install mongoose” because it’s already installed. You can check this by typing: “npm view mongoose version” or “npm view mongodb version”.

I would completely ignore that section and see if you run into issues. I was able to get everything passing. When you get to step 15, just realize that it states that the Model and Server layer tests are passing and the Feature tests are failing. It’ll walk you through uncommenting sections in wdio.conf.js and bin/www.