500 error occurs when the project executes the node service

Why does it appear?

Insert picture description here

This error indicates that your server has crashed


Why did it collapse?

  • Because you triggered a bug when executing a function, that is, the code is wrong, it naturally collapsed

Where did it collapse?

  • When you run the project, you definitely need to run the node service. You open the cmd panel that runs the node service, and you will see an error message.
    Insert picture description here
    Like my one, the error message is an internal error in other files I call.

    Generally, your server source program will not make mistakes, because if you make mistakes, you will not be able to run it. The place where you make mistakes is when you call other files.

Resolve errors

Find the corresponding wrong place he reported

Verify code correctness

Everyone's code is different, you can only modify it here


I show my mistake:

Insert picture description here

  • My code here is sloppy when calling the database
  • The correct one should be:
	db.collection(collName).findOne(whereObj,cb)
Published 74 original articles · praised 7 · visits 2201

Guess you like

Origin blog.csdn.net/qq_44163269/article/details/105267434