[尝试启动纱线时出现奇怪的IP-EADDRNOTAVAIL

问题描述 投票:1回答:1

我在笔记本电脑上安装了全新的OpenSUSE安装,并试图测试一个全新的React应用程序。

我从create-react-app站点运行了以下命令:

    npx create-react-app my-app
    cd my-app
    yarn start

发生这种情况时,我在终端中得到以下输出

yarn run v1.15.2
$ react-scripts start
Attempting to bind to HOST environment variable: linux-wjcv
If this was unintentional, check that you haven't mistakenly set it in your shell

Could not find an open port at linux-wjcv
Network error message:  listen EADDRNOTAVAIL 92.242.140.2

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

我确认linux-wjcv是我的计算机名,但是我不确定92.242.140.2 IP地址是从哪里来的。谷歌快速搜索告诉我,该IP位于爱尔兰,而离我不远。

我快速查看了/ etc / hosts中的hosts文件,看到的所有内容都将通过127.0.0.1。因此,我不确定该IP的来源或为什么新的应用程序会尝试使用它。

127.0.0.1   localhost

# special IPv6 addresses
::1         localhost ipv6-localhost ipv6-loopback

fe00::0     ipv6-localnet

ff00::0     ipv6-mcastprefix
ff02::1     ipv6-allnodes
ff02::2     ipv6-allrouters
ff02::3     ipv6-allhosts

如果这是一个愚蠢的问题,我表示歉意。我对运行Unix OS还是很陌生。

node.js reactjs yarnpkg opensuse
1个回答
0
投票

您的主机名“ linux-wjcv”未在hosts文件中定义,因此系统尝试通过DNS查找其ip地址。尝试这样定义它:127.0.0.1 localhost linux-wjcv

© www.soinside.com 2019 - 2024. All rights reserved.