简体   繁体   English

无法使用 vue CLI 3

[英]Unanble to use vue CLI 3

After installing vue CLI 3 I was unale to vue create my-app throwing this error zsh: command not found: vue But when installing the vue CLI I notice this error:安装 vue CLI 3 后,我无法vue create my-app抛出此错误zsh: command not found: vue但是在安装 vue CLI 时我注意到此错误:

npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
/home/b-hantsi/.npm-global/bin/vue -> /home/b-hantsi/.npm-global/lib/node_modules/@vue/cli/bin/vue.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@vue/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @vue/compiler-sfc@3.0.5 requires a peer of vue@3.0.5 but none is installed. You must install peer dependencies yourself.

+ @vue/cli@4.5.11
updated 1 package in 138.616s

The one that you shared...it generally shows up when you install vue-cli.您共享的那个...它通常会在您安装 vue-cli 时显示。 The reason that you are unable to create a project is because you probably might have not installed it globally.您无法创建项目的原因是您可能尚未全局安装它。 So try running the below command in the command line inside the directory where you are trying to create a vue project因此,请尝试在您尝试创建 vue 项目的目录中的命令行中运行以下命令

vue --version

After running the above command if it doesn't show any version number like 4.5.1 etc. Then it means the vue was not installed globally.运行上述命令后,如果没有显示任何版本号,如 4.5.1 等,则表示 vue 未全局安装。 So then you need to run the following commands to have it installed globally.因此,您需要运行以下命令来全局安装它。 If you are using yarn then run the yarn commands else the npm commands如果您使用的是纱线,则运行纱线命令,否则运行 npm 命令

yarn remove global @vue/cli    OR      
npm uninstall -g @vue/cli

yarn add global @vue/cli  OR
npm install -g @vue/cli

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM