Search code examples
vue.jsnpmnpx

why must use "npx" to cek version program on npm global?


I have a problem when I use the npm command. why when I use the npm command to check the version program must use npx? it does not work when I don't use npx For example when I use Vue --version to check cli vue version

vue --version
bash: vue: command not found

npx vue --version
@vue/cli 5.0.6

npx error


Solution

  • Try updating your PATH variable with this command:

    export PATH=$PATH:/Users/denis/.npm-global/bin
    

    Updating Node/NPM might help too.