Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when creating a vue project with CLI

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?

like image 503
Lahiru Mirihagoda Avatar asked Dec 10 '22 02:12

Lahiru Mirihagoda


2 Answers

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

like image 185
Satyam Pathak Avatar answered Dec 14 '22 19:12

Satyam Pathak


a) uninstall yarn so create will fall back to npm

b) explictly tell it to use npm:

vue create myproject --packageManager npm 
like image 41
Sarjerao Ghadage Avatar answered Dec 14 '22 18:12

Sarjerao Ghadage