2

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?

Evan
  • 2,327
  • 5
  • 31
  • 63
  • Make sure you have an Environmental Path set to the correct location. https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10 First, figure out where node is installing the global modules - browse to `C:\Program Files\nodejs\node_modules\npm\bin ` ..do you see a Vue package in there? Or does it live in: `C:\Users\Computer\AppData\Roaming\npm\node_modules ` ...Is that path part of your Environmental Path Variables? What happens when you do `node -v` and `npm -v` ? – Matt Oestreich Mar 10 '19 at 05:05
  • if i do command like node -v or --version also npm -v or --version it works fine. – Evan Mar 10 '19 at 05:09
  • interesting... I would check that other thread - something is up with your Environmental Path variables. – Matt Oestreich Mar 10 '19 at 05:10

4 Answers4

1

try to reinstalll everything with node 8.11.0 as it's recommanded by @vue/cli

A.Abdelhak
  • 140
  • 4
1

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.

amendx
  • 36
  • 3
1

In my case the problem was the package name change:

Warning regarding Previous Versions

The package name changed from vue-cli to @vue/cli. If you have the previous vue-cli (1.x or 2.x) package installed globally, you need to uninstall it first with npm uninstall vue-cli -g or yarn global remove vue-cli.

soure: https://cli.vuejs.org/guide/installation.html

danigore
  • 411
  • 1
  • 5
  • 8
0

Try to add following in Path System variable and restart command prompt.

C:\Users\{YourAccount}\AppData\Roaming\npm\node_modules\yarn\bin

once added issue yarn -v and you will see the version output.

Once yarn installed issue below command to install vue-cli

yarn global add @vue/cli @vue/cli-service-global
vue --version will show you the version
Waqas Ahmed
  • 4,801
  • 3
  • 36
  • 45