Search code examples
powershellvue.jsvue-cli-3

Windows power shell: vue --version 'is not recognized'


I am trying to learn vuejs.

  1. Run Power shell as an Administrator.

  2. Installed it globally:

    C:\Windows\system32> npm install -g @vue/cli

  3. This message appeared:

npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead C:\Users\Computer\AppData\Roaming\npm\vue -> C:\Users\Computer\AppData\Roaming\npm\node_modules@vue\cli\bin\vue.js

> protobufjs@6.8.8 postinstall C:\Users\Computer\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\protobufjs
> node scripts/postinstall


> nodemon@1.18.10 postinstall C:\Users\Computer\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\nodemon
> node bin/postinstall || exit 0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\@vue\cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ @vue/cli@3.5.0
added 680 packages from 509 contributors in 124.261s
  1. Then I want to check it's version using 'vue --version':

    C:\Windows\system32> vue --version

vue : The term 'vue' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + vue --version + ~~~ + CategoryInfo : ObjectNotFound: (vue:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

I have tried Uninstalled and Reinstall. still not working.

  • my version of node : v10.15.3
  • my version of npm : 6.4.1

What should I do?


Solution

  • Check out if your prefix is set correctly to your AppData/Roaming/npm/node_modules/ (etc..)

    Type npm config get prefix and see if it's there.

    If doesn't, that may be causing your -g packages to be installed somewhere else. Do npm config set prefix C:/users/your_user/AppData/Roaming/npm and then try installing some package. That might solve any of unrecognized dependecies to occur.