Cannot fully install and set-up mongoose:
Describe your issue in detail here.
When i try to run on replit, the console shows error code “ELIFECYCLE” and “errno 1”
pointing to the name tag on package-JSON.
please see attached.
Thanks for your advice.
Regarding the replit link, couldn’t generate a specific link due to rejection at the console level.
Happy to adapt to your suggestion.
You needed to scroll up and read the full error message
/home/runner/boilerplate-mongomongoose-11/myApp.js:14
let Person = mongoose.model('Person', peopleSchema);
^
SyntaxError: Identifier 'Person' has already been declared
Looking at your code you wrote this
let Person;
let peopleSchema = new mongoose.Schema({
name : { type: String, required: true },
age : Number,
favoriteFoods : [String]
})
let Person = mongoose.model('Person', peopleSchema);
Also, make sure you are using the correct mongo db version from the instructions.
Add mongodb@~3.6.0 and mongoose@~5.4.0 to the project’s package.json .
When I make those changes I am able to pass the test.
Let me take these out and resend. The above were when i tried to bypass the error on the installation of mongoose.
The dependencies have the correct versions of ~3.6.0 and ~5.4.0
i just amended but same error message. i will probably start on a different topic and return at a later date.
Many thanks for your time.
Much appreciated