gpt4 book ai didi

HostNotFoundError error when running 'npm start' on Node.js server - React Project(对Node.js服务器-Reaction项目运行‘NPM Start’时出现HostNotFoundError错误)

转载 作者:bug小助手 更新时间:2023-10-24 18:36:36 27 4
gpt4 key购买 nike



Description of the problem:

问题描述:


I'm working on a React project and when trying to run npm start on the server folder, I get the following error:

我正在处理一个Reaction项目,当尝试在服务器文件夹上运行NPM Start时,我收到以下错误:


HostNotFoundError [SequelizeHostNotFoundError]: getaddrinfo ENOTFOUND undefined

Problem Details:

The project consists of three important files in the server folder: db.js, index.js and server.js. I think the error might be related to one of these files, but I'm not sure which one.

I leave you the link to the project's github repository:
Link to the Repository: https://github.com/Mateo-mh/PI-countries

Steps to Reproduce the Error:

1) I navigate to the server folder in my project.
2) I run the npm start command in the terminal.

Complete Error Message:

[0] HostNotFoundError [SequelizeHostNotFoundError]: getaddrinfo ENOTFOUND undefined
[0] parent: Error: getaddrinfo ENOTFOUND undefined
[0] at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
[0] errno: -3008,
[0] code: 'ENOTFOUND',
[0] syscall: 'getaddrinfo',
[0] hostname: 'undefined'
[0] },
[0] original: Error: getaddrinfo ENOTFOUND undefined
[0] at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
[0] errno: -3008,
[0] code: 'ENOTFOUND',
[0] syscall: 'getaddrinfo',
[0] hostname: 'undefined'
[0] }
[0] }

Tools and Technologies Version:

Node.js: v18.16.1
sequelize: v6.31.1

I would greatly appreciate your help in resolving this issue. Does anyone have any idea why I'm getting this error and how I can fix it?

更多回答

Can you show your sequelize code where you connect to the database?

你能在你连接到数据库的地方展示你的顺序化代码吗?

优秀答案推荐

It looks like there is issue in db.js where you had define your database cred, as according to error your database cred is wrong.

看起来在您定义数据库凭据时,在db.js中有问题,因为根据错误,您的数据库凭据是错误的。


更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com