使用字符串模板${}时需要table上面的符号`(反单引号),不是单引号。 console.log(`Server running at http://${hostname}:${port}/`); 转载于:https://www.cnblogs.com/jianghan7/p/10754922.html