vue.js 我遇到了“npm run dev”缺少脚本的问题,如何解决?

a0x5cqrl  于 2022-12-04  发布在  Vue.js
关注(0)|答案(4)|浏览(709)

I am currently in the folder E:\Learn\app-code-vue

E:\Learn\app-code-vue>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\Shrikant Rana\AppData\Local\npm-cache\_logs\2022-01-24T14_
26_36_332Z-debug.log
bmp9r5qi

bmp9r5qi1#

See the scripts that are configured with Vue CLI 3 in the package.json file

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

so you can run by use this : npm run serve

8ehkhllq

8ehkhllq2#

检查你的package.json文件,看看你的"scripts"键中是否有dev。如果你想运行一个dev命令,你的package.json脚本标记应该是这样的:

"scripts": {
    "start": "node index.js",
    "dev": "concurrently \"npm run server\" \"npm run client\""
  },
hwamh0ep

hwamh0ep3#

使用npm run serve
对我很有效

0ve6wy6x

0ve6wy6x4#

您可能需要检查是否确实位于正确的文件夹中

相关问题