5

I'm trying to create a Vue project using the Vue CLI in Ubuntu, but keep getting the same error. I've already installed the Vue CLI using sudo npm i -g @vue/cli.

Here is the error message:

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 processTicksAndRejections (internal/process/next_tick.js:81:5)

What is the reason for this?

1

4 Answers 4

13

As per the error it's trying to find yarn's config file in node_modules. You does not have yarn packageManager installed in your system I believe

Try this vue config -s packageManager npm

and re-run vue create

Sign up to request clarification or add additional context in comments.

Comments

4

a) uninstall yarn so create will fall back to npm

b) explictly tell it to use npm:

vue create myproject --packageManager npm 

Comments

0

Uninstalling node and npm then restarting my pc and then reinstalling them worked for me.

sudo apt remove nodejs

sudo apt autoremove

Reinstalling it

sudo apt install nodejs

sudo apt install npm

Comments

0

The following helped me. Even though yarn was already installed, I ran

npm install -g yarn

And repeated

vue create project-name

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.