I replaced password with my actual password in this post I did not actually write password there. The images attached are the error message and my secrets file.
Looks like it is a bug with the version of the driver and Node 20. Updating mongoose should fix it.
Open the Shell tab and run npm i mongoose@latest
You can also remove the options object from the connect call as both those options are now deprecated.
BTW, it looks like Gitpod is now the preferred option and not Replit. The challenge instructions have been updated accordingly. But I’m guessing it still works fine with Replit.
Sorry if it’s out of pocket, but running " npm i mongoose@latest" would work too? I tried it in the terminal but it didn’t work. I assume there’s some difference, because when I saw video examples they usd npm start, but I would have to write npm run start for the same process.
Sorry, don’t english all that well.
Installing/updating dependencies and running the start script are two different things.
Running npm i someDependency@latest will update the dependency. You can check the version in the package.json file.
npm start and npm run start is the same command. There are a few run commands that do not need run as part of the command. It runs the start script found in package.json under the scripts section.
Upgrading to mongoose latest (^8.8.4 ) did fix the deprecation warning for me and I’m using node v21.7.1.
However, when completing the ‘Create Many Records’ challenge I get the error: Person.remove is not a function. Is this a mongoose version issue for the server.js file?
In some cases, you might be able to update the version and use the new methods and still pass the challenge tests. But that is far from guaranteed.
For the fCC challenges, you should stay with the dependencies in the boilerplate to avoid issues. So far, there are no breaking changes that strictly requires the boilerplate to be updated. We could update the dependencies and methods taught, but that may be more work than it is worth if the tests need to be updated as well. Pretty sure this part of the curriculum is going to be legacy soon enough.
As long as it is just a deprecation warning, it doesn’t affect anything. It is just warning you that future versions of Node will start to throw, but as long as the version of Node you are using isn’t throwing, you can just ignore the warning and use the boilerplate dependencies. I just tested it with the current Node LTS version (22.12.0 as of writing) and it still is just a deprecation warning.
The initial posts I made about this issue (Node/Mongoose/MongoDB driver) wasn’t with the challenge in mind. I hadn’t connected it to an fCC challenge initially.
TL;DR stay with the boilerplate dependencies and ignore the deprecation warning.