5

I installed node.js, run apache via xampp, and configured my apache server so that I can use www.example.com as my practice server domain on my local machine.

I started my command prompt as admin and typed the following lines but and they all ran successfully:

install vue-cli

$ npm install --global vue-cli

create a new project using the "webpack" template

$ vue init webpack my-project

install dependencies and go!

$ cd my-project
$ npm install
$ npm run dev

I followed the cli installation section on https://v2.vuejs.org/v2/guide/installation.html

When I go to my folders, all the vue.js files are installed inside 'my-project', but when I go to my apache server at www.example.com or www.example.com/my-project, a blank page shows. And if I got into my index.html file in the 'my-project' folder and edit it to:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>project3</title>
  </head>
  <body>
    <div id="app">sdfsf</div>
    <!-- built files will be auto injected -->
  </body>
</html>

I just get a blank page with the text sdfsf. What am I doing wrong? why isn't vue.js hello install screen page loading?

3
  • 1
    after npm run dev, if you just go to browser and enter http://localhost:8080/, what do you see? Commented Dec 15, 2016 at 8:15
  • wow, it is installed there, I missed it, thanks, lol, my bad :) Commented Dec 15, 2016 at 8:16
  • how do I change which port it is installed on? Commented Dec 15, 2016 at 8:22

1 Answer 1

5

When you run:

npm run dev

It starts a Node JS server. The exact command can be found in package.json, and you can see the result by going to http://localhost:8080/.

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

2 Comments

how do I change the port number it's run on if I want a different port than 8080? I can't find anything in package.json regarding port number.
@SimonSuh It will in the config folder, port should be mentioned in the file which is being used when you run npm run dev(see package.json for this). In my case it is config/index.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.