错误:对http://something.localhost/static/locales/de/common.json的请求失败,原因:getaddrinfo ENOTFOUND

时间:2019-04-20 20:51:31

标签: node.js postgresql nginx erlang elixir

当我使用yarn dev节点运行前端时,转到http://something.localhost时会抛出此错误

request to http://something.localhost/static/locales/de/common.json failed, reason: getaddrinfo ENOTFOUND something.localhost something.localhost:80
FetchError: request to http://something.localhost/static/locales/de/common.json failed, reason: getaddrinfo ENOTFOUND something.localhost something.localhost:80
    at ClientRequest.<anonymous> (/Users/igordumencic/Desktop/Work/project/frontend/node_modules/node-fetch/index.js:133:11)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:391:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)

我可以直接打开http://something.localhost/static/locales/de/common.json,它可以在浏览器中正常打开

谢谢

1 个答案:

答案 0 :(得分:0)

它告诉您在端口80的function after_registration() { $current_user = wp_get_current_user(); update_user_meta( $current_user->mycred_default, 'mycred_balance', '1000'); } add_action('user_register', 'after_registration'); 上找不到任何内容。您的主机文件中可能没有引入something.localhost的条目,并且可能仅存在something.localhost