问题形容

应用 npm run serve 命令启动 Vue.js 我的项目时无奈启动。具体报错如下:

$ npm run serve > front-end@0.1.0 serve> vue-cli-service servesh: 1: vue-cli-service: not foundnpm ERR! code 127npm ERR! path /home/codists/projects/flask-vue-blog/front-endnpm ERR! command failednpm ERR! command sh -c vue-cli-service servenpm ERR! A complete log of this run can be found in:npm ERR!     /home/codists/.npm/_logs/2021-06-09T13_29_30_797Z-debug.log

问题定位

1、曾经应用 npm install -g @vue/cli 装置了 Vue CLI。且 package.json 文件外面也蕴含了 "@vue/cli-service": "~4.5.0"

然而有可能装的有问题,所以重新安装。

解决办法

1、重新安装

$ rm -rf node_modules/$ npm install