magic-mirror-demo
magic-mirror-demo copied to clipboard
NPM update causes problems
Like an idiot i did a simple npm update on my project folder and killed the project...
Everything has been working fine for months without issues.. Now i get the following error on start, seems to be trying to start mongo and fails
D:\mm\node_modules\mongodb-core\lib\topologies\server.js:353
throw MongoError.create(f('server instance in invalid state %s', self.s.state));
^
MongoError: server instance in invalid state undefined
at Function.MongoError.create (D:\mm\node_modules\mongodb-core\lib\error.js:29:11)
at Server.connect (D:\mm\node_modules\mongodb-core\lib\topologies\server.js:353:21)
at Server.connect (D:\mm\node_modules\mongodb\lib\server.js:361:17)
at new MongoStore (D:\mm\node_modules\connect-mongodb\lib\connect-mongodb.js:93:19)
at Object.
Short follow up: After rolling back the npm modules one by one I found that the upgrade of mongoose created the issue... version 4.4.19 works fine...the latest vertion 4.7.5 breaks the connection as described above...
When i run npm update mongoose I think the error above might have something to so with the error i get when rolling back:
npm WARN deprecated [email protected]: Please use 2.2.16 or higher due to a regression in updateOne/Many upsertedId return
Rolled back and now mirror workes again.... Quote: "Dont fix something thats not broken"
UPDATE:///this breaks something else :(
Changing the connection string in server.js makes the problem go away (meaning I don't know if I broke anything else)
mongoose.connect(connectionString, { useMongoClient: true, });