Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda