[Solved] vue: command not found

While are you trying to run the server as npm run serve. Then you will face vue: command not found, this error.

In this article, we will discuss about this vue: command not found error in VueJs. And how to resolve the error all the possible solutions with examples.

How to vue: command not found Error Occurs?

Most of the time you get this error while the run server as npm run serve.

vue: command not found

How To Fix vue: command not found Error?

There are different ways to fix vue: command not found this error. Let us take a look at every solution.

  • How To Fix vue: command not found Error?

For the Solve vue: command not found Error You need to install the vue-cli package globally by running this command: npm install -g @vue/cli and set the correct PATH in your system’s environment variable. First of all you have to uninstall vue-cli by running this command in your terminal: npm uninstall vue-cli -g and then re-install vue-cli by running this command: npm install -g @vue/cli. Now, check your vue is installed or not by running this command: vue –version If your vue-cli is installed then you can create a new project with this command: vue create my-project Now, I hope your error will be solved.

  • vue: command not found Error

For the solve vue: command not found Error First of all run this command to get your npm folder path: npm config get prefix And then Export path by running this command with bin folder: export PATH=/usr/local/share/npm/bin:$PATH And if You are using yarn then run this command: export PATH=$PATH:/home//.yarn/bin Now, your error will be solved.

Solution 1: re-install vue-cli

First of all you need to uninstall vue-cli globally by running this command in your terminal.

npm uninstall vue-cli -g

And then re-install vue-cli by this command:

npm install -g @vue/cli

Now, check your Vue is installed or not by running this command:

vue --version

If your Vue-cli is installed in your system globally then you can create new project with this command.

vue create my-project

Now, I hope your error will be solved.

Solution 2: Export PATH

First of all run this command to get your npm folder path.

npm config get prefix

And export the path by running this command.

export PATH=/usr/local/share/npm/bin:$PATH

Now, I hope your error will be gone.

Conclusion

In this article, we have discussed what causes the error and we have discussed ways to fix the error.

we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Categories