missing script: dev npm err!
时间: 2023-11-09 12:08:51 浏览: 172
运行 npm run dev 报错
"missing script: dev"错误是由于在执行npm run dev命令时,没有找到对应的"dev"脚本引起的。
通过查看引用中的package.json文件中的脚本配置,可以看到有一个名为"dev"的脚本:"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js"。这个脚本定义了开发环境的配置,以及使用webpack-dev-server运行项目的命令。
如果在执行npm run dev时出现"missing script: dev"错误,可能是因为package.json文件中没有正确配置"dev"脚本。请确保package.json文件中存在以下内容:
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"build": "node build/build.js"
}
如果该部分不存在,请手动添加并保存文件。然后再次执行npm run dev命令,应该能够正常运行vue项目了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [npm ERR! missing script dev](https://blog.csdn.net/JunWeiJodn/article/details/125011845)[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: 50%"]
- *2* *3* [npm ERR! missing script: dev](https://blog.csdn.net/f10495703/article/details/118889586)[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: 50%"]
[ .reference_list ]
阅读全文