CCCPaste

some shit about the express project

nodemon shit:
https://stackoverflow.com/questions/63423584/how-to-fix-error-nodemon-ps1-cannot-be-loaded-because-running-scripts-is-disabl
he best way to get rid of this error is
Run the below command in your windows power shell as admin

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

Basically it will ask you to change the execution policy then type Y .

**OR**

You can do is without changing your execution Policy

Install nodemon using this command : npm i nodemon -g
then type nodemon -v you will see a path in first line of error go to that path then delete that nodemon.ps1 file or filename with.ps1xml extension.

Make sure that you are installing nodemon globally For more details microsoft execution policies docs

/////////////// mongoose error:
https://www.youtube.com/watch?v=j2nv6cfAsp0

to start the app: npm start


https://stackoverflow.com/questions/69840504/mongooseserverselectionerror-connect-econnrefused-127017


I finally solved it.

Enabling the IPV6 that MongoDB has disabled by default. Using the following command line on CMD:

mongod --ipv6

And then try again the connection and it works!

const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/notes-db-app',{
useNewUrlParser: true,
useUnifiedTopology: true
})
.then(db => console.log('DB is connected'))
.catch(err => console.log(err));