我初始化了一个nuxt项目,当我尝试使用npm run dev或yarn dev命令运行它时,它会返回以下错误:
build [================== ] 91%Error: getaddrinfo ENOTFOUND localhost
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
error Command failed with exit code 1.
知道它来自哪里?
答案 0 :(得分:7)
将127.0.0.1 localhost添加到/ etc / hosts