You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Vue.js项目执行npm run server报错missing script: server求助

解决npm run server报错"missing script: server"的问题

Hey there, let's fix this issue right away!

The error you're seeing npm ERR! missing script: server is super straightforward — you've used the wrong script name in your command. Take a look at your package.json file's scripts section:

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

Notice there's no server script listed here, but there is a serve one that's meant to start the development server.

The Fix

Instead of running npm run server, use this command in your cmd:

npm run serve

That should fire up your Vue project's development server without any issues.

A quick reminder for future reference: Whenever you hit a "missing script" error with npm, always check the scripts block in your package.json — it lists all the valid commands you can run with npm run.

内容的提问来源于stack exchange,提问作者ffblord

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.12 03:50:26