使用 CLI 创建 vue 项目时出错

Lah*_*oda 4 npm vue.js vue-cli-3

我正在尝试在 Ubuntu 中使用 Vue CLI 创建一个 Vue 项目,但一直出现相同的错误。我已经使用sudo npm i -g @vue/cli.

这是错误消息:

00h00m00s 0/0: : 错误错误: 命令失败: yarn config get registry 错误: [Errno 2] 没有这样的文件或目录: 'config'

错误:命令失败:yarn config get registry

错误:[Errno 2] 没有这样的文件或目录:'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) 在 processTicksAndRejections (internal/process/next_tick.js:81:5)

这是什么原因?

Sat*_*hak 8

根据error它试图在node_modules. yarn我相信您的系统中没有安装packageManager

尝试这个 vue config -s packageManager npm

并重新运行 vue create