美文网首页
node报错throw new TypeError('"list

node报错throw new TypeError('"list

作者: QRFF | 来源:发表于2020-05-11 18:52 被阅读0次

const http = require('https')

const PORT = 8000
const serverHandle = require('../app')

const server = http.createServer(serverHandle)
server.listen(PORT)

简单的几行代码竟然报错
events.js:239
throw new TypeError('"listener" argument must be a function');
^

TypeError: "listener" argument must be a function

原因:node版本问题
解决:http换成https

相关文章

网友评论

      本文标题:node报错throw new TypeError('"list

      本文链接:https://www.haomeiwen.com/subject/lcdpnhtx.html