node报错throw new TypeError('"listener" argument must be a function')

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('"listener" argument must be a function'))