seamus
seamus

Reputation: 2901

How do I specify a valid entry point / file for Vue projects?

Came back to an old Vue project. Try to bring it up on my local machine using 'vue serve' and I got the following error.

How do I specify a valid entry point for vue projects?

Command:

vue serve

Terminal Error:

"Failed to locate entry file in /Users/$username/Desktop/my-project.
"Valid entry file should be one of: main.js, index.js, App.vue or app.vue.

Upvotes: 4

Views: 3108

Answers (3)

Deepak Terse
Deepak Terse

Reputation: 712

A better way of doing this would be to specify the path to the main.js file in the package.json file as follows:

"scripts": {
    "dev": "vue serve src/main.js",
    "prod": "vue build src/main.js"
}

And then simply run

npm run dev

for serving the project in the development environment and

npm run prod

for creating a production build under dist folder

Upvotes: 0

m Piroli
m Piroli

Reputation: 383

npm run serve need to type this command .

Upvotes: 0

seamus
seamus

Reputation: 2901

vue serve src/main.js

Need to add the file to start from after the serve command

Upvotes: 4

Related Questions