问题
I am new to vue.js and at first I installed node.js then vue and vue/cli. But when I am trying to run server as -> npm run serve But getting error like 'vue-cli-service' is not recognized as an internal or external command.
I used codes for installation as below
npm install -g vue npm install -g @vue/cli
can someone guide me what to do to solve this issue ?
回答1:
I think you are using cmd
in windows.
Try deleting the node_modules
folder and after that run npm i
from the cmd.
Then try running npm run serve
again and see if it works this time
回答2:
In my case, the package @vue/cli-service
is installed in my local node_modules environment, but not my global environment, so it cannot be used as a command. I type .\node_modules\.bin\vue-cli-service serve
and it works.
来源:https://stackoverflow.com/questions/58579843/how-to-solve-vue-cli-service-is-not-recognized-as-an-internal-or-external-comm