Abhilash D K
Abhilash D K

Reputation: 1309

Not able to start Svelte

Installed svelte using the below command:

When I try to run npm run dev I get the bellow error:

[email protected] dev /Working/Svelte/first-app run-p start:dev autobuild

[email protected] autobuild /Working/Svelte/first-app rollup -c -w

[email protected] start:dev /Working/Svelte/first-app sirv public --dev

events.js:180 throw er; // Unhandled 'error' event ^

Error: getaddrinfo ENOTFOUND x86_64-apple-darwin13.4.0 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) Emitted 'error' event at: at GetAddrInfoReqWrap.doListen [as callback] (net.js:1412:12) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:17) { errno: 'ENOTFOUND', code: 'ENOTFOUND', syscall: 'getaddrinfo', hostname: 'x86_64-apple-darwin13.4.0'

My Node version is - v12.6.0, OS MacOS Mojave

Can anybody help me out to figure what's wrong?

Thanks in Advance

Upvotes: 0

Views: 1455

Answers (2)

Everton Mendonça
Everton Mendonça

Reputation: 688

On OSX, I just did a unset HOST at my terminal. Then npm run dev executed without problems.

Upvotes: 1

mtnmtn13
mtnmtn13

Reputation: 81

I had this issue on Linux (OpenSUSE 15.1) and managed to fix it, but I haven't tried it on MacOS. The basic issue seems to be that the local machine's hostname is not resolved to an IP. For me it turned out it was because I had set a custom hostname, but did not update /etc/hosts, so dns.js failed to resolve it. So basically I had an existing custom hostname:

$ cat /etc/hostname
mycustomhostname

And I edited /etc/hosts from:

127.0.0.1       localhost

...

To:

127.0.0.1       localhost
127.0.1.1       mycustomhostname


...

And Svelte managed to start after that.

Again, not sure if the same would work on MacOS, but there might be another way to get it to resolve your hostname.

EDIT: There is also a simpler way that might work, if you run

export HOST=localhost

then

npm run dev

It will bind to localhost instead of trying to use the custom hostname. Hope this helps!

Upvotes: 3

Related Questions