为什么在express js上启动应用会报错:getaddrinfo ENOTFOUND localhost
Why is the error displayed when starting the application on expreess js: getaddrinfo ENOTFOUND localhostss
当我尝试 运行 托管 API 应用程序时,我收到以下消息:
2022-04-11T12:32:31: Server running at http://localhost:9000
2022-04-11T12:32:31: Error: getaddrinfo ENOTFOUND localhostss
2022-04-11T12:32:31: at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
2022-04-11T12:32:31: errno: -3008,
2022-04-11T12:32:31: code: 'ENOTFOUND',
2022-04-11T12:32:31: syscall: 'getaddrinfo',
2022-04-11T12:32:31: hostname: 'localhostss',
2022-04-11T12:32:31: fatal: true
2022-04-11T12:32:31: }
请帮我解决
index.js:
enter image description here
主机名错误
根据错误主机名是 localhostss 而不是 localhost
当我尝试 运行 托管 API 应用程序时,我收到以下消息:
2022-04-11T12:32:31: Server running at http://localhost:9000
2022-04-11T12:32:31: Error: getaddrinfo ENOTFOUND localhostss
2022-04-11T12:32:31: at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
2022-04-11T12:32:31: errno: -3008,
2022-04-11T12:32:31: code: 'ENOTFOUND',
2022-04-11T12:32:31: syscall: 'getaddrinfo',
2022-04-11T12:32:31: hostname: 'localhostss',
2022-04-11T12:32:31: fatal: true
2022-04-11T12:32:31: }
请帮我解决
index.js: enter image description here
主机名错误 根据错误主机名是 localhostss 而不是 localhost