Npm start error : MongoParseError: URI malformed, cannot be parsed [Solved]

Please assist on my below error. Tried for a long time with no success??

C:\Users\Asus\Downloads\mflix-js>npm start

server@1.0.0 start C:\Users\Asus\Downloads\mflix-js
nodemon -L ./index.js
[nodemon] starting node ./index.js
MongoParseError: URI malformed, cannot be parsed
at parseConnectionString (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb-core\lib\uri_parser.js:211:21)
at connect (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:180:3)
at connectOp (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\operations\mongo_client_ops.js:284:3)
at C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\utils.js:437:24
at new Promise ()
at executeOperation (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\utils.js:432:10)
at MongoClient.connect (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\mongo_client.js:168:10)
at Function.MongoClient.connect (C:\Users\Asus\Downloads\mflix-js\node_modules\mongodb\lib\mongo_client.js:372:22)
at Object. (C:/Users/Asus/Downloads/mflix-js/src/index.js:23:13)
at Module._compile (internal/modules/cjs/loader.js:689:30)

I finally solved. it is the dotenv_win file to change to .env


never mind

I don’t understand. you renamed the dotenv_win to .env_win?

Rename “.dotenv_win” to “.env” (as in Readme.rst) instead of “.ini” as stated in the “.dotenv_win” comments.

am having the same prob how can i fix it i tried to rename the file to env_win but still i have an error

The file has to be . env, it will not work if you rename it env_win.


mv dotenv_unix .env # on Unix
ren dotenv_win .env # on Windows

Is there no support for Mac then?

I have just the same issue

Worked for me (mac user) by renaming dotenv_unix to .env. Thank you!

Just read the README file.

Thanks! It’s really helpful.

You should rename tp just to .env