我是编码世界的新手,目前正在学校学习,但我似乎遇到了一个我无法解决的问题。我正在尝试使用终端运行我的 index.js 文件,但我不断收到此错误:
Error: Cannot find module 'C:\Users\salij\OneDrive\Desktop\U2A\index
'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
我不知道我错过了什么,因为查看我所提供的步骤,我不应该收到此错误。这是我的代码,以防有人可以帮助我。TIA
const express = require ('express')
const app = express ()
const formidable = require ('formidable')
app.use(express.static (__dirname + "/WebCalculatorSolution/WebCalculator"))
app.get('/', (req,res)=>{
const word = req.query.word
res.write('<h1>${word}</h1>')
res.end()
})
const port = 8000
app.listen(port, ()=>{
console.log('Server ready at: http://localhost:${port}')
})
温温酱
潇湘沐
BIG阳
红颜莎娜
相关分类