大家好,任何人都可以帮我解决这个问题,因为我从早上就面临这个问题。
app.use("/", require(path.json(__dirname,"routes")));
问题发生在上面一行。
C:\Users\user\Desktop\fullstack-project-Sumit-malviya-au8\backend\server.js:16
app.use("/", require(path.json(__dirname,"routes")));
TypeError: path.json is not a function
at Object.<anonymous> (C:\Users\user\Desktop\fullstack-project-Sumit-malviya-au8\backend\server.js:16:27)7)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
答案 0 :(得分:0)
path.json
不存在;
尝试使用 path.join(__dirname, 'routes')