How to solve 'vue-cli-service' is not recognized as an internal or external command?

十年热恋 提交于 2020-04-16 20:08:10

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!