Categories
CLI Linux NPM Programming Vue.js

Pro-tip: `npm run dev` Relies on /etc/hostname

In my ongoing effort to play with Vue.js, I’ve been attempting to run the command npm run dev, which is required to turn the Vue magic into regular Javascript magic (all computers are magic). I couldn’t figure out why it kept insisting it couldn’t bind to the address.

I was looking for a config file with a hostname defined. There isn’t one. It uses the contents of /etc/hostname.

PS1 and hostname showed my hostname as kraken. But according to /etc/hostname, it was kraken.kjcoop.com. NPM was trying to bind to kjcoop.com’s IP address.

There’s no reason the hostname had to include kjcoop.com. I originally took to putting it in the hostname when I first registered the domain name in 1998 because I thought it was neat. I never got out of the habit because until [longer ago than I care to admit], it never caused me problems.