A summary of the differences between npm run dev and npm run serve _node.js_ Script home

Summary of differences between npm run dev and npm run serve

Updated: Mar 01, 2024 15:31:02 Author: Back End Long
npm run serve and npm run dev are two common commands that use npm to run scripts in the development phase. This article introduces the difference between the two, which has certain reference value and is of interest to you

1. Analyze the npm run

npm

npm is the Node.js package manager that allows you to install, update, delete, and manage Node.js modules and applications.

run

run is a subcommand of npm that executes the scripts defined in the scripts section of the package.json file.

dev

dev is the name of a script command defined in the scripts section of the package.json file. In general, the name dev is short for development environment, meaning that this command is typically used to start the development server or perform development-related tasks.

在这里插入图片描述

To summarize: in a Vue.js project, npm run dev might actually execute the command vue-cli-service serve

2. Difference between dev and serve

In fact, the script defined in the scripts section of the package.json file is different

在这里插入图片描述

This article about the difference between npm run dev and npm run serve is introduced to this, more about the difference between npm run dev and npm run serve please search the previous articles of Script Home or continue to browse the following related articles hope that you will support Script home in the future!

Related article

  • 详解利用 Express 托管静态文件的方法

    Explain how to use Express to host static files

    This article mainly introduces the method of using Express to host static files in detail, Xiaobian feel very good, now share to you, also give you a reference. Let's take a look
    2017-09-09
  • node简单实现一个更改头像功能的示例

    node simply implements an example of changing avatars

    This article mainly introduces the node simple implementation of a change profile picture function example, Xiaobian feel very good, now share with you, also give you a reference. Let's take a look
    2017-12-12
  • Node定时备份MySQL的实现

    Implementation of Node periodic backup MySQL

    This article mainly introduces the implementation of Node timing backup MySQL, the article through the example code is very detailed, for everyone's study or work has a certain reference learning value, the need of friends below with the small series to learn together
    2023-04-04
  • 如何利用node实现静态文件缓存详解

    How to implement static file caching with node

    HTTP caching mechanism as an important means of Web application performance optimization, for engaging in the Web Development students, it should be the foundation of the knowledge system, but also want to become the front-end architecture of the necessary skills, this article mainly introduces you about how to use node to achieve static file caching related information, need friends can refer to it
    2021-07-07
  • 利用node.js本地搭建HTTP服务器

    Set up an HTTP server locally using node.js

    This article mainly introduces in detail the relevant information about using node.js to build an HTTP server locally, which has certain reference value, and interested partners can refer to it
    2017-04-04
  • Node.js环境下Koa2添加travis ci持续集成工具的方法

    Method of adding travis ci Continuous integration tool to Koa2 in Node.js environment

    This article mainly introduces the method of adding travis ci continuous integration tool to Koa2 in the Node.js environment. The article is very detailed and has certain reference and learning value for everyone. The friends who need to follow Xiaobian together to learn it.
    2017-06-06
  • linux 下以二进制的方式安装 nodejs

    Install nodejs in binary mode on linux

    This article mainly introduces linux in a binary way to install nodejs, the article gives you a very detailed introduction, has a certain reference value, the need of friends can refer to
    2020-02-02
  • Express框架定制路由实例分析

    Express framework to customize routing instance analysis

    This article mainly introduces the Express custom routing, combined with the example form analysis of the express framework custom routing principle, usage and related precautions, the need of friends can refer to
    2023-05-05
  • Linux系统中利用node.js提取Word(doc/docx)及PDF文本的内容

    In Linux system, node.js is used to extract Word(doc/docx) and PDF text content

    This article mainly introduces you about the Linux system using node.js to extract Word(doc/docx) and PDF text content, the article gives a detailed example code for your reference to learn, the need for friends following the small series to take a look at it.
    2017-06-06
  • node操作mysql数据库实例详解

    Description node operations on the mysql database example

    This article mainly introduces the node operation mysql database, combined with examples of the form of a more detailed analysis of node operation database connection, add, delete, modify, transaction processing and error handling related operation skills, need friends can refer to
    2017-03-03

Latest comments