Bug collection of node.js

*、Error: Can't set headers after they are sent.

The first type: node.js adopts an asynchronous response mechanism, so if res.send() occurs multiple times, the previous response stream will be closed, causing an exception
The solution is to comment out the redundant res.send();
The second: Track the specific code and setHeader(); Comment the line with the error, this method is potentially dangerous, choose carefully

 

*、Failed to lookup view "/searchUser.ejs" in views directory

The routing is abnormal, there is a problem with the path writing, check the specific jump instructions of the code

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326997293&siteId=291194637