How do I generate a C# Client from Azure Autorest? - autorest

To solve this question I think I need to generate a client sdk for my api.
I have installed Autorest and am trying the command
AutoRest -mynamespace mytrack.Client -CodeGenerator CSharp -Modeler
Swagger -Input swagger.json -PackageName mytrack.client -AddCredentials true
The results are
AutoRest code generation utility [version: 2.0.4262; node: v10.1.0]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
(node:9764) ExperimentalWarning: The fs.promises API is experimental
ERROR: Schema violation: Object didn't pass validation for format email:
- file:///C:/dev/autoresttest/swagger.json:1:156 ($.info.contact.email)
FATAL: swagger-document/individual/schema-validator - FAILED
FATAL: Error: [OperationAbortedException] Error occurred. Exiting.
Process() cancelled due to exception : [OperationAbortedException] Error occurred. Exiting.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 7)
(node:9764) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 8)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 10)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 11)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 12)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 13)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 14)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 15)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 16)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 17)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 18)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 19)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 20)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 21)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 22)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 23)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 24)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 25)
(node:9764) UnhandledPromiseRejectionWarning: Error: [OperationAbortedException] Error occurred. Exiting.
at C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\lib\pipeline\schema-validation.js:30:19
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 26)
(node:9764) UnhandledPromiseRejectionWarning: TypeError: volume[member].bind is not a function
at patchFilesystem (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:277:43)
at C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:281:18
at Object.global.staticloader.undo (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:163:7)
at process.exit.n [as exit] (C:\Users\kirst\AppData\Roaming\npm\node_modules\autorest\dist\static-loader.js:170:27)
at main (C:\Users\kirst\.autorest\#microsoft.azure_autorest-core#2.0.4279\node_modules\#microsoft.azure\autorest-core\dist\app.js:514:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:9764) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 27)
Shutting Down

I had left the email out of the Swagger Contact information set in SwaggerDoc

Related

mongo-express does not connect to mongodb

i have installed mongodb and i am able to connect via shell, now i am trying to install mongo-express, the installation was successful, i copied config.default.js file in config.js but it can't connect to mongo. As can be seen from the error it cannot retrieve the hostname
(node:3085) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Use `node --trace-deprecation ...` to show where the warning was created)
Could not connect to database at index "0"
(node:3085) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [undefined:27017] on first connect [Error: getaddrinfo ENOTFOUND undefined
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26) {
name: 'MongoNetworkError'
}]
at Pool.<anonymous> (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/topologies/server.js:438:11)
at Pool.emit (events.js:315:20)
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/pool.js:562:14
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/pool.js:995:11
at /Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:32:7
at callback (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:280:5)
at Socket.<anonymous> (/Users/name/.config/yarn/global/node_modules/mongodb/lib/core/connection/connect.js:310:7)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
(node:3085) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3085) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I had the same error.
Forcing the connection URL fixed it for me :
mongo-express --url "mongodb://localhost:27017" --admin
(--admin option allows to list all databases)

How do I resolve a MongooseServerSelectionError?

When I run my code, which should connect my database to my node server, nothing works out.
Here is the output I recieve.
Server is running on port: 5000
(node:1628) UnhandledPromiseRejectionWarning: MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster.
One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/
at NativeConnection.Connection.openUri (C:\Users\aharn\Documents\EXERCISE-TRACKER\mern-exercise-tracker\backend\node_modules\mongoose\lib\connection.js:830:32)
at Mongoose.connect (C:\Users\aharn\Documents\EXERCISE-TRACKER\mern-exercise-tracker\backend\node_modules\mongoose\lib\index.js:335:15)
at Object.<anonymous> (C:\Users\aharn\Documents\EXERCISE-TRACKER\mern-exercise-tracker\backend\server.js:16:10)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
(node:1628) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can't connect to mongodb cloud

I'm working on a web application with node.js and using Mongodb for database. everything is cool when I run my app in localhost. but when I run it in a shared host it gives an error which looks like its Mongoose connection problem.
here is my code:
const uri = 'mongodb://****:****#iranroboticacademy-bdziw.mongodb.net/test';
mongoose.connect(uri,{ useNewUrlParser: true });
mongoose.connection.once('open', function(){
console.log('DataBase is connected. ');
}).on('error', function(error){
console.log('Connection error:', error);
});
and here is the erro that I get when I run the app in host:
Connection error: { MongoNetworkError: failed to connect to server [iranroboticacademy-shard-00-00-bdziw.mongodb.net:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 3.226.212.92:27017]
at Pool.<anonymous> (/home/iranrob1/public_html/node_modules/mongodb/lib/core/topologies/server.js:433:11)
at Pool.emit (events.js:182:13)
at createConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:577:14)
at connect (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:1021:9)
at makeConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:31:7)
at callback (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:247:5)
at TLSSocket.err (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:276:7)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoNetworkError',
[Symbol(mongoErrorContextSymbol)]: {} }
(node:6409) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [iranroboticacademy-shard-00-00-bdziw.mongodb.net:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 3.226.212.92:27017]
at Pool.<anonymous> (/home/iranrob1/public_html/node_modules/mongodb/lib/core/topologies/server.js:433:11)
at Pool.emit (events.js:182:13)
at createConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:577:14)
at connect (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/pool.js:1021:9)
at makeConnection (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:31:7)
at callback (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:247:5)
at TLSSocket.err (/home/iranrob1/public_html/node_modules/mongodb/lib/core/connection/connect.js:276:7)
at Object.onceWrapper (events.js:273:13)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:6409) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:6409) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Sure you can use the free tier of MongoDB Cloud.
It’s actually much easier to mantain than the hosted version as you have visually all under control, automatic backups etc.
https://mongodb.com
I have asked my host provider in a ticket and they said it doesn’t support mongodb. I have written everything with mongodb database in my application and I really can’t change it into other things. I need to use it in this host. Is there anyone who has a solution for this?!
try to use 'connect to your aplication', copy the then change the

I"m getting an error while trying to run my DB

UnhandledPromiseRejectionWarning: MongoParseError: Invalid connection string
at parseConnectionString (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongodb-core\lib\uri_parser.js:505:21)
at connect (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\node_modules\mongodb\lib\operations\mongo_client_ops.js:195:3)
at connectOp (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\node_modules\mongodb\lib\operations\mongo_client_ops.js:284:3)
at executeOperation (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\node_modules\mongodb\lib\utils.js:416:24)
at MongoClient.connect (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\node_modules\mongodb\lib\mongo_client.js:175:10)
at Promise (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\lib\connection.js:612:12)
at new Promise (<anonymous>)
at NativeConnection.Connection.openUri (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\lib\connection.js:609:19)
at Mongoose.connect (C:\Users\We'regonnalose\Desktop\newDB\node_modules\mongoose\lib\index.js:321:15)
at Object.<anonymous> (C:\Users\We'regonnalose\Desktop\newDB\app.js:3:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
(node:4716) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:4716) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
const mongoose=require('mongoose');
mongoose.connect('mongdb://localhost:27017/shopDB', {useNewUrlParser:true});
You have a typo in the connection string:
mongdb://localhost:27017/shopDB
it should be mongodb instead of mongdb as the protocol
mongodb://localhost:27017/shopDB

unable to access json server

I created a mock json server and trying to open in browser ,landing in the following error:
events.js:167
throw er; // Unhandled 'error' event
^
Error: listen EACCES 127.0.0.1:8000
at Server.setupListenHandle [as _listen2] (net.js:1313:19)
at listenInCluster (net.js:1378:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1491:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:55:10)
Emitted 'error' event at:
at emitErrorNT (net.js:1357:8)
at process._tickCallback (internal/process/next_tick.js:63:19)
Please help.