XP SP3系统上启动静态服务报错,求帮忙
发布于 6 年前 作者 arvin0 1918 次浏览 来自 问答
const path = require('path');
var connect = require("connect");
var serveStatic = require("serve-static");
var open = require("open");


var app = connect();
// app.use(serveStatic("C:\\xxx\\xxx\\xxx\\项目文件夹"));
var _path = path.resolve(__dirname, '../');
console.log(_path);
app.use(serveStatic(_path));
app.listen(33322);
console.log('Server running at http://127.0.0.1:33322/');

12.png

2 回复

端口被占用了吧,看下你是不是启动着同一个端口呢

@jiangli373 确实是这个原因,谢谢

回到顶部