0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

getaddrinfo ENOTFOUND localhost エラーの対処法

Posted at

vue3でフロントを作っている最中にこのようなエラーが起きた

> @0.0.0 dev
> vite

error when starting dev server:
Error: getaddrinfo ENOTFOUND localhost
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:internal/dns/promises:42:17) 

原因を探ってみると/private/etc/hostsのファイルがおかしいらしい。

127.0.0.1   localhost

を追加してみると直りました。

前に別プロジェクトでファイルをいじった時に消えていたみたいです。
1ヶ月前にファイルをいじったのに今エラーが出たのはなぜか気になりますが、わかり次第記載します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?