📜  路径错误 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:04.392000             🧑  作者: Mango

代码示例1
TypeError: path must be absolute or specify root to res.sendFile
    at ServerResponse.sendFile (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\response.js:425:11)
    at C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\index.js:63:14
    at Layer.handle [as handle_request] (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\route.js:137:13)
    at Route.dispatch (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\route.js:112:3)
    at Layer.handle [as handle_request] (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\index.js:281:22
    at Function.process_params (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\index.js:335:12)
    at next (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\express\lib\router\index.js:275:10)
    at jsonParser (C:\Users\Jonas\Documents\codeprojects\nodeJsTestApi\backend\node_modules\body-parser\lib\types\json.js:110:7)