【问题标题】:How to fix error " No such file or directory error" with vue-cli create如何使用 vue-cli create 修复错误“没有这样的文件或目录错误”
【发布时间】:2019-10-14 23:35:04
【问题描述】:

我安装了 vue-cli 3。我尝试使用 vue create 创建一个 vue 应用程序,但出现 no such file 错误。

~$ 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.

【问题讨论】:

  • “我安装了 vue-cli 3” ????听起来不行。你是怎么安装的?
  • 你安装了 vue-cli 3 global 吗? npm install -g @vue/cli
  • 是的,我确实安装了 vue-cli 3

标签: vue.js vue-cli-3


【解决方案1】:

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      我刚刚解决了这个错误,只需添加sudo like sudo npm update -g @vue/cli #OR sudo yarn global upgrade --latest @vue/cli

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-06-23
        • 2019-09-28
        • 2016-07-22
        • 1970-01-01
        • 2021-10-31
        • 1970-01-01
        • 1970-01-01
        • 2019-09-13
        相关资源
        最近更新 更多