Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
Not working "serve" command for Vue js project

working with Laravel + Vue js. but when I try to start vue js using npm run serve command. it is en counting following error command in my cmd .

npm ERR! Missing script: "serve"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

how could I fix this problem?

package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.24.0",
        "cross-env": "^7.0",
        "laravel-mix": "^6.0.39",
        "lodash": "^4.17.19",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.15.2",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.6.14"
    },
    "dependencies": {
        "vue": "^2.6.14",
        "vue-axios": "^3.3.7",
        "vue-router": "^3.5.2",
        "vue-sweetalert2": "^5.0.2"
    }
}

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

This is not only vue js app. you are using vue with Laravel

If you want to create production build you have to run npm run prod. If you working local then you should use npm run watch. it will use hot reload so it will detect file changes and create complied filed.

Note : you have to add resourse js & css file to webpack.mix.js file and define the destination to store complied file in public folder.

You don't have to use npm run serve because you are using vue js in laravel.

about 4 years ago · Juan Pablo Isaza Report

0

Check if you have the below content inside the package.json, if not add it and then try running the commands

"scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    // other commands
  },

Edit:

If you are using cmd in windows.

Follow the below steps

  1. Try deleting the node_modules folder and after that run npm i from the cmd.

  2. Then try running npm run serve again and see if it works this time

  3. if the above two steps don't work then install vue/cli service globally by running the command npm install @vue/cli-service -g and then follow step 1 and 2 sequentially

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!