0

I'm have some issues when trying to install Vue CLI on my mac device. I am using the terminal and I also want to work with yarn and not with npm. These are the commands used:

yarn global add @vue/cli

After doing that I got a message on the terminal where it says that it has been successfully installed. However, when I try to run one of the commands:

"vue" or "vue --version"

I get the following message => zsh: command not found: vue

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
R-C
  • 11
  • 4
  • It should work. Try restarting terminal. It's also possible you messed up your PATH variable. See [this answer](https://stackoverflow.com/a/18428774/1891677). – tao Jul 22 '22 at 18:27
  • Unfortunately I still have the same issue after doing this – R-C Jul 22 '22 at 18:39

2 Answers2

0

You should use npm instead it will work.

yarn global remove @vue/cli

and then install using npm.

npm install -g @vue/cli

don't worry! on normally you can use yarn but for global use npm.

solution - 2

yarn global bin

add yarn global directory into your path

  • If I try running npm install -g @vue/cli i get into this error: npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/@vue/cli/bin/vue.js' -> '/usr/local/bin/vue' – R-C Jul 22 '22 at 19:35
0

Update, i fount the issue. So basically I was missing one extra command. This is the chronological order for commands:

yarn global add @vue/cli

export PATH="$(yarn global bin):$PATH"

vue

R-C
  • 11
  • 4