0

I was trying to make some app with vue and installed npm command.

when I run "npm run serve" command, I get the following messages. It seems that I was supposed to run app at "http://localhost:8080/" and was able to access sample pages, not like "x86_64-apple-darwin13.4.0:" stuff.

is it possible to solve this with changing config file or something ?

App running at:
  - Local:   http://x86_64-apple-darwin13.4.0:8080/
  - Network: http://x86_64-apple-darwin13.4.0:8080/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

I am supposed to access to http://localhost:8080/ and would get some sample pages.

2 Answers 2

5

It seems like your host environment was set to x86_64-apple-darwin13.4.0, you should be able to set the variable in your bash_profile like this HOST="localhost"

after that reload the environment with source ~/.bash_profile

Sign up to request clarification or add additional context in comments.

4 Comments

You are welcome, would you mind accepting the answer?
sorry. I was not used to posting questions. I accepted answer :)
I am also having a similar issue. If the HOST variable is not present in my ~/.profile (have no `.bash_profile due to OS) can I just write it in there and the ants keep marching on?
sudo nano ~/.bash_profile add this line at the end: HOST="localhost" Save it then run , source ~/.bash_profile
0

Looks like you can find an answer to your question here - https://forum.vuejs.org/t/npm-run-serve-is-not-defaulting-to-localhost/88007/13.

In a short:

  • Add vue.config.js file in a root (same level as package.json file) if you don't have one

  • Add the following settings to vue.config.js

module.exports = {
  devServer: {
    host: '127.0.0.1',
    port: 8080,
    public: 'localhost:8080',
  }
}

1 Comment

thank you for commenting. This approach is reasonable. But, I could not access to localhost even though "Network:" was changed. ( it seems that the person who was on your links also have same trouble with me, and still had trouble in the end). Thank you so much.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.