Home>

I got the following error when trying to use vue-cli for the first time in a while.

zsh: command not found: vue


Uninstall the original vue,
I reinstalled it with the following command.

npm install --global vue-cli


But I still get the same error
Please tell me how to resolve!

What I tried

I passed the pass as I checked by google.
I put the vue path in .zshrc. This is the bottom line.

export PS1 = "% ~% n"
Added the following to run #pyenv
export PYENV_ROOT = "$HOME/.pyenv"
export PATH = "$PYENV_ROOT/bin: $PATH"
eval "$(pyenv init-)"
export PATH = "/ Users/nakamura/.npm-global/lib/node_modules/vue-cli/bin: $PATH"

Still it didn't work
I also put the path in my .bash_profile.

export PATH = "/ Users/nakamura/.npm-global/lib/node_modules/vue-cli/bin: $PATH"
Environmental information, etc.

MAC OS Catalina
Version 10.15.7

npm version 6.14.6

Postscript

Output during installation

$npm install --global vue-cli
npm WARN deprecated [email protected]: This package has been deprecated in favorite of @ vue/cli
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: this library is no longer supported
/Users/nakamura/.npm-global/bin/vue-init->/Users/nakamura/.npm-global/lib/node_modules/vue-cli/bin/vue-init
/Users/nakamura/.npm-global/bin/vue->/Users/nakamura/.npm-global/lib/node_modules/vue-cli/bin/vue
/Users/nakamura/.npm-global/bin/vue-list->/Users/nakamura/.npm-global/lib/node_modules/vue-cli/bin/vue-list
+ [email protected]
added 236 packages from 204 contributors in 6.759s
  • Answer # 1

    I reinstalled it with the following command.
    npm install --global vue-cli

    If you execute that command, the installation destination will be displayed after completion.
    All you have to do is put the PATH in the installation destination.

    I passed the pass as I checked by google.

    Even if you find it by google, it may not be the same as your environment.

  • Answer # 2

    I didn't know whether to write the path in bash or zsh
    In my case zsh was positive. Perhaps it can be judged from the error statement.

    It looks like I had to do the following to reflect the changes in the .zshrc file!

    source .zshrc


    I was able to hit the vue command!

    $vue -V
    2.9.6