我从节点js开始,但是当我尝试运行我的项目时,它一直显示此错误:
Error: Cannot find module 'D:\goweek\backend\src\index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
这就是我要做的一切:
const express = require('express');
const app = express();
app.get('/', (req, res) => {
return res.send("Hello World");
})
app.listen(3000, () => {
console.log("Server started on port 3000");
});