Skip to content
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

yarn error with vue create #3994

Closed
arthurmougin opened this issue May 14, 2019 · 10 comments
Closed

yarn error with vue create #3994

arthurmougin opened this issue May 14, 2019 · 10 comments

Comments

@arthurmougin
Copy link

arthurmougin commented May 14, 2019

Version

3.7.0

Environment info

 System:
    OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 8.10.0 - /usr/bin/node
    Yarn: 1.16.0 - /usr/local/bin/yarn
    npm: 3.5.2 - /usr/bin/npm
  Browsers:
    Chrome: 74.0.3729.108
    Firefox: Not Found
  npmGlobalPackages:
    @vue/cli: 3.7.0

Steps to reproduce

$ npm init
$ npm install @vue/cli
(? i may have used "yarn" in between)
$ vue create myproject

What is expected?

the create process appears

What is actually happening?

00h00m00s 0/0: : ERROR Error: Command failed: yarn config get registry
ERROR: [Errno 2] No such file or directory: 'config'

Error: Command failed: yarn config get registry
ERROR: [Errno 2] No such file or directory: 'config'

at makeError (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/usr/local/lib/node_modules/@vue/cli/node_modules/execa/index.js:278:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

this can be a setup process issue as I'm still learning the nodejs ecosystem. But it appeared every time I executed it wherever I installed vue in.

@LinusBorg
Copy link
Member

despite running the create command with npm, vue-cli will try to use yarn to install the packages for that new projec for you - if it's installed. (We can't detect how you ran the create command so can't deduce from that).

Since you appearantly have yarn installed, it tries to use yarn, but fails since your yarn config / installation seems broken?

You should check to see if running yarn config get registry works in your terminal.

Assuming yarn installation really is broken and you don't succeed in fixing it, as a workaround you can

a) uninstall yarn so create will fall back to npm
b) explictly tell it to use npm:

vue create myproject --packageManager npm 

@sodatea
Copy link
Member

sodatea commented May 14, 2019

Another workaround:

vue config -s packageManager npm

@sodatea
Copy link
Member

sodatea commented May 22, 2019

Closing due to inactivity.

@sodatea sodatea closed this as completed May 22, 2019
@Akryum
Copy link
Member

Akryum commented May 22, 2019

@sodatea Use the need feedback label and the stale bot will kick in.

@sodatea
Copy link
Member

sodatea commented May 22, 2019

@Akryum Ahh I thought it was "stale" and failed to find one. Will definitely use it next time.

@mattsplat
Copy link

Following this post worked for me.
yarnpkg/yarn#3708 (comment)
sudo apt-get -o Dpkg::Options::="--force-overwrite" install yarn

@agnelvishal
Copy link

Uninstall yarn by

sudo apt remove cmdtest
sudo apt remove yarn

@rcolomina
Copy link

Same problem for me. I've just removed yarn from my system.
sudo rm -rf /usr/bin/yarn

@tychenjiajun
Copy link

This usually happens on Ubuntu since yarn on Ubuntu is cmdtest and yarnpkg is the actual yarn we want. Is there any way to detect the OS and choose the right command?

@zier95
Copy link

zier95 commented Feb 5, 2021

you can use npm install -g yarn to have a try.
If you also have wrong ,you can use npm install -g nrm ,
and change the image (to use npm ),nrm use npm,
and then , to create a new project again~ luck to you~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants