NPM Start error

I have been following all of the instructions within the Readme.RST file. IT has taken a fair bit of trial and error but I have managed to get to the stage of importing the data which seems to have worked and running the npm install which also seemed to work. I have edited the .env file as well.

On trying to run npm start I got the following error:

C:\Users\ross1\M220\mflix-js>npm start

server@1.0.0 start C:\Users\ross1\M220\mflix-js
nodemon -L ./index.js

[nodemon] 1.17.5
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node ./index.js
MongoParseError: URI does not have hostname, domain name and tld
at parseSrvConnectionString (C:\Users\ross1\M220\mflix-js\node_modules\mongodb-core\lib\uri_parser.js:40:21)
at parseConnectionString (C:\Users\ross1\M220\mflix-js\node_modules\mongodb-core\lib\uri_parser.js:225:12)
at connect (C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:180:3)
at connectOp (C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:284:3)
at C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\utils.js:437:24
at new Promise ()
at executeOperation (C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\utils.js:432:10)
at MongoClient.connect (C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\mongo_client.js:168:10)
at Function.MongoClient.connect (C:\Users\ross1\M220\mflix-js\node_modules\mongodb\lib\mongo_client.js:372:22)
at Object. (C:/Users/ross1/M220/mflix-js/src/index.js:23:13)
[nodemon] app crashed - waiting for file changes before starting…

Could I get some guidance please.

HI @Andrew_16682,

Please share the .env file contents here so that we can take a look.


I had this same error. It looks like .env is not configured but in the video they do not configure that file before running npm start. Is there instruction on how to set up the .env file?

found the Problem

delete the file name “dotenv_win”
delete those words and the file will only be ".env "
It doesn’t have any name it is just .env
Put Nothing before the .env just leave it blank