Difference between" npm run serve" and "npm run dev" in VUE

npm run serve basically is just saying “npm please run the command I defined under the name serve in package.json” the same happens with npm run dev.

Given this the commands can do the exact same thing, similar things, or very different things. Usually they are a shorthand for running a dev server on localhost, but it’s not a rule, only a convention.

So you’ll need to check in your package.json file and look for

1
2
3
4
"scripts": {
"serve": "[list of commands here]",
"dev": "[list of commands here]"
},

请我喝杯咖啡吧~

支付宝
微信