Search code examples
apacheinstallationcommand-line-interfacevue.jscommand-prompt

how do i install Vue.js using cli on my local machine using Apache?


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?


Solution

  • 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/.