vue.jsnpmvue-cli-3

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?


Solution

  • 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