vue2 Missing script: "serve" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run
时间: 2023-11-08 08:06:10 浏览: 71
这个错误提示是因为在运行 `npm run serve` 命令时,没有在 package.json 文件中定义 serve 脚本。可以通过以下两种方式解决:
1. 在 package.json 文件中添加 serve 脚本:
```
"scripts": {
"serve": "vue-cli-service serve"
}
```
2. 直接运行 `vue-cli-service serve` 命令启动开发服务器。
相关问题
vue3.0Missing script: "serve" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run
引用: 使用npm run dev 报错时 npm ERR! Missing script: “dev” PS E:\big-screen-vue-datav-master> npm run dev npm ERR! Missing script: "dev" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\yudengsheng\AppData\Local\npm-cache\_logs\2022-08-08T13_38_17_020Z-debug.log PS E:\big-screen-vue-datav-master> vue init webpack 。
这个报错是因为在项目的package.json文件中没有定义名为“dev”的脚本,所以无法执行npm run dev命令。可以通过运行npm run命令来查看可用的脚本列表。
引用: 今天朋友有个报错让我给看一下:启动vue项目时,报错,启动不了 问题描述: npm ERR! missing script: serve npm ERR! A complete log of this run can be found in: 这里指的是丢失了script中的serve,run找不到,所以启动不了 原因分析:
这个报错是因为在项目的package.json文件中缺少名为“serve”的脚本。确保在package.json文件的scripts部分中添加了serve脚本。
你可以通过运行npm run命令查看可用的脚本列表,以确定是否添加了serve脚本。
npm ERR! Missing script: "serve" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run
引用: 这个错误是因为在配置文件中的服务器名称与你启动命令中的名称不匹配导致的。如果你在运行npm启动项目时遇到了`npm ERR! missing script: serve`的错误,意味着在你的配置文件中并没有定义名为"serve"的脚本。要解决这个问题,你可以运行`npm run`命令来查看所有可用的脚本列表。<span class="em">1</span>
#### 引用[.reference_title]
- *1* [vue启动项目报错:npm ERR! missing script: serve解决方法](https://blog.csdn.net/m0_46374969/article/details/120436121)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)