Today I am trying to run vue-cli-service serve But I am facing the following error: ‘vue-cli-service’ is not recognized as an internal or external command in VueJs. In this Exerror article, We are going to learn about How to reproduce this error and we will discuss All Possible Solutions Lets Get Start with This Article.
How ‘vue-cli-service’ is not recognized as an internal or external command Error Occurs?
I am trying to run vue-cli-service serve But I am facing the following error:
'vue-cli-service' is not recognized as an internal or external command
So here I am writing all the possible solutions that I have tried to resolve this error.
How To Solve ‘vue-cli-service’ is not recognized as an internal or external command Error?
- How To Solve 'vue-cli-service' is not recognized as an internal or external command Error?
To Solve 'vue-cli-service' is not recognized as an internal or external command Error You need to reinstall vue-cli. First of all Uninstall vue-cli by running this command in your terminal: npm uninstall vue-cli -g And then install vue/cli-service and vue/cli both globally by using this command: npm install -g @vue/cli-service && npm install -g @vue/cli Now, you can run the serve command: npm run serve Then Your error must be solved.
- 'vue-cli-service' is not recognized as an internal or external command
To Solve 'vue-cli-service' is not recognized as an internal or external command Error You need to delete node_modules first and then run npm install and Now you can serve your project and Your error will be solved. First Of all Delete your node_modules manually Or You can run this command: rm -rf node_modules And then Delete package-lock.json file: rm -f package-lock.json Now, Clear your npm cache by running this command: npm cache clean –force Then Install npm using this command: npm install Now, Your error will be solved. Thank You.
Solution 1: Follow this
To Solve ‘vue-cli-service’ is not recognized as an internal or external command Error You need to delete node_modules first and then run npm install and Now you can serve your project and Your error will be solved.
First Of all Delete your node_modules manually Or You can run this command.
rm -rf node_modules
And then Delete package-lock.json file.
rm -f package-lock.json
Now, Clear your npm cache by running this command.
npm cache clean --force
Then Install npm using this command:
npm install
Now, Your error will be solved. Thank You.
Solution 2: Install vue-cli
You need to reinstall vue-cli. First of all Uninstall vue-cli by running this command in your terminal.
npm uninstall vue-cli -g
And then install vue/cli-service and vue/cli both globally by using this command.
npm install -g @vue/cli-service
npm install -g @vue/cli
Now, you can run the serve command.
npm run serve
Then Your error must be solved.
Conclusion
It’s all About this error. I hope We Have solved Your error. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
Also, Read
- Unchecked runtime.lastError: The message port closed before a response was received
- export ‘default’ (imported as ‘Vue’) was not found in ‘vue’
- npm WARN using –force Recommended protections disabled
- ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ‘deprecated-react-native-prop-types’
- node-sass: Command failed