如何使用 vue-cli create 修复错误“没有这样的文件或目录错误”

Osb*_*aka 1 vue.js vue-cli-3

我安装了 vue-cli 3。我尝试使用 vue create 创建一个 vue 应用程序,但我没有收到这样的文件错误。

~$ vue create hello-world
bash: /usr/local/bin/vue: No such file or directory

Run Code Online (Sandbox Code Playgroud)

安装 vue/cli3

yarn global v0.15.1
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed @vue/cli@3.12.0 with binaries:
      - vue
Done in 1.69s.
Run Code Online (Sandbox Code Playgroud)

Jav*_*rez 8

我希望这对某人有所帮助,但同样的事情发生在我身上,我只需要在尝试使用它之前重新启动终端。我的意思是,在安装 vue-cli 并npm i -g @vue/cli重新启动终端或使用以下内容更新源代码后:(source ~/.bash_profile或者只是重新启动终端,更简单)这样您的配置文件中的路径就会更新:)。那为我修好了。