Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 293
Simon Suh Avatar asked Dec 15 '16 08:12

Simon Suh


People also ask

Can I install vue CLI locally?

Installation RecapIt may be a good idea to install the Vue CLI locally so that you can lock the version that you are going to be using.

How do I run VueJS project on localhost?

Open in browser To view the project, open a tab and type http://localhost:3000 into the URL bar. That's the address that the Node server is listening to.

How do you check vue CLI is installed or not?

You can verify that it is properly installed by simply running vue , which should present you with a help message listing all available commands.


1 Answers

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

like image 87
Saurabh Avatar answered Sep 30 '22 06:09

Saurabh