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

时间:2019-10-14 23:35:04

标签: vue.js vue-cli-3

我安装了vue-cli3。我尝试使用vue create创建一个vue应用程序,但没有出现此类文件错误。

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

安装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.

2 个答案:

答案 0 :(得分:2)

我希望这对某人有帮助,但我也遇到了同样的情况,我只需要在尝试使用终端之前重新启动终端即可。我的意思是,在使用npm i -g @vue/cli安装vue-cli之后,重新启动终端或使用类似以下内容的源:source ~/.bash_profile(或者只是重新启动终端,更容易),以便配置文件中的路径得到更新:) 。这为我解决了。

答案 1 :(得分:0)

使用 npm i -g @vue/cli 安装 vue-cli 并使用类似 source ~/.profile 或 (~/.bash_profile) 之类的内容更新源代码后.这对我有用。