New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: spawn yarn ENOENT
on vue create
with a clean install
#5891
Comments
Apparently there was a stray yarn config that clashes with vue-cli. Odd. |
That was premature, now there's an error when actually creating the project:
|
vue create
command (clean install)Error: spawn yarn ENOENT
on vue create
with a clean install
can you give us a little bit more information about your environment what is your node version what is your yarn version etc? Also could you provide a little bit more information when exactly the error is occurring? you wrote that it happens after trying to create a project with default options - a screenshot of the terminal, showing which of the steps were already done or in progress before the error appeared would be helpful |
Okay, so I just figured out that vue-cli requires yarn. That might be worth adding to the docs? I'm still a little confused why it would require yarn though. |
It does not require yarn. It work with both npm and yarn. And it checks which is available on your system and then chooses that. You can also force it to use one or the other with a flag. This is documented in the guide,. though could likely be more prominant. For some reason, it seems to have falsely "detected" yarn on your system - maybe from a prior install was was not completely removed? |
I uninstalled yarn completely and vue-cli only started working when I reinstalled yarn through Homebrew again. Doesn't seem to make a ton of sense (I only use npm but had yarn installed from waaaay back apparently). Other people are also having this issue by the way, see: #5690 |
Same errors here with npm global install. using nvm do not want to cross-pollute node with brew-node. vui ui allows me to create projects however. cli is broken here in my town |
I had an issue when I deleted Yarn from windows that some files stayed in AppData\Local\Yarn. Deleting them solved the problem for me |
I also had the same issue. I am using Ubuntu. Note: Before this, I installed yarn with which the error was resolved. But would recommend to use the above method. |
I've got the same issue after removing yarn in Windows 10. Package Manager was set to yarn on my ~/.vierc file { |
Thank you. I also ran into the same issue using ASDF for managing different node environments and this gave me a lot of headache. Deleting the |
tl;dr If you previously installed yarn with brew run "brew unlink yarn && brew link yarn" I had the same issue immediately after updating vue-cli. This apparently removed /usr/local/bin/yarn which is the symlink created by running "brew install yarn" and points to /usr/local/Cellar/yarn/1.22.10/bin/yarn. Fix is to recreate the symlink /usr/local/bin/yarn by running "brew unlink yarn && brew link yarn" |
For Windows users uninstall and reinstall yarn it will solve your issue. |
@aritro-rakshit ...thanks |
I also came across the same issue. I have npm and yarn both installed globally in my system. But the vue-cli (4.1.2) could not choose (or prompt me to choose) the package manager. I have fixed it by setting a flag |
@andersenmp Thank you! Your answer solved my problem. |
Hi. I have the same error after |
Version
4.5.6
Environment info
Steps to reproduce
What is expected?
The project to be created
What is actually happening?
An error is thrown when creating the project (default options)
The text was updated successfully, but these errors were encountered: