Problem description

The vue.js project could not be started using the NPM run serve command. The specific error is as follows:

$NPM run serve > [email protected] serve > vue-cli-service serve sh: 1: vue-cli-service: Not found NPM ERR! code 127 npm ERR! path /home/codists/projects/flask-vue-blog/front-end npm ERR! command failed npm ERR! command sh -c vue-cli-service serve npm ERR! A complete log of this run can be found in: npm ERR! /home/codists/.npm/_logs/2021-06-09T13_29_30_797Z-debug.logCopy the code

Problem orientation

Vue CLI has been installed using NPM install -g@vue /cli. Json file also contains “@vue/cli-service”: “~4.5.0”.

But there may be a problem with the installation, so reinstall.

The solution

1. Reinstall the installation

$ rm -rf node_modules/
$ npm install
Copy the code