在安装vue CLI3之后,我无法使用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发布于 2021-01-25 00:11:34
当您安装vue-cli时,通常会显示您共享的...it。无法创建项目的原因是您可能尚未全局安装该项目。因此,尝试在试图创建vue项目的目录内的命令行中运行以下命令
vue --version在运行上述命令后,如果它没有显示任何版本号,如4.5.1等,则意味着vue没有全局安装。因此,您需要运行以下命令来全局安装它。如果您正在使用yarn,则运行yarn命令,否则运行npm命令
yarn remove global @vue/cli OR
npm uninstall -g @vue/cli
yarn add global @vue/cli OR
npm install -g @vue/clihttps://stackoverflow.com/questions/65871256
复制相似问题