【发布时间】:2017-06-03 02:03:20
【问题描述】:
我在 nodejs 上有项目,我是 nodejs 的初学者。 当我尝试使用它时
app.get('/', function(req, res) res.sendfile('index.html');});
它告诉我使用 sendFile(calital F)。 当我在 sendFile 中使用大写 F 时,它会显示此错误
TypeError: path must be absolute or specify root to res.sendFile
在 ServerResponse.sendFile 处
帮帮我怎么办
【问题讨论】:
-
npm与 node.js 捆绑在一起。在没有安装 node.js 的情况下如何安装npm? -
是的,我也安装了 npm 和 nodejs
-
那你为什么要运行
npm install nodejs? -
您的输出似乎是用于运行
npm install nodejs。运行npm install express时的输出是什么? -
现在,我没事!但是有这个问题