Trying to npm start ..... and failed

I got to access mongodb with URI by shell … but I´m not getting with “npm start”.
what´s it wrong?

URI malformed, cannot be parsed ???

Giving a complete message:

> server@1.0.0 start
> nodemon -L ./index.js

[nodemon] 1.19.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node ./index.js`
MongoParseError: URI malformed, cannot be parsed
    at parseConnectionString (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\core\uri_parser.js:568:21)
    at connect (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\operations\connect.js:281:3)
    at C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\mongo_client.js:259:5
    at maybePromise (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\utils.js:692:3)
    at MongoClient.connect (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\mongo_client.js:255:10)
    at Function.connect (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\mongodb\lib\mongo_client.js:400:22)
    at Object.<anonymous> (C:\Users\zulia\Documents\MongoDB\mflix-js\src\/index.js:23:13)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Module._compile (C:\Users\zulia\Documents\MongoDB\mflix-js\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
[nodemon] app crashed - waiting for file changes before starting...

I renamed “.dotenv_win” to “.env”

Please share the content.

We have to see it to be able to tell you what is malformed.

2 Likes