简体   繁体   English

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

[英]How to fix error " No such file or directory error" with vue-cli create

I installed vue-cli 3. I tried creating a vue app with vue create but I get a no such file error.我安装了 vue-cli 3。我尝试使用 vue create 创建一个 vue 应用程序,但我得到一个 no such file 错误。

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

Installing vue/cli3安装 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.

I hope this helps somebody but the same happened to me, I just had to restart the terminal before attempting to use it.我希望这对某人有所帮助,但同样的事情发生在我身上,我只需要在尝试使用它之前重新启动终端。 I mean, after install vue-cli with npm i -g @vue/cli restart the terminal or update the source with something like: source ~/.bash_profile (or just restart the terminal, is easier) so the path in your profile gets updated:).我的意思是,在使用npm i -g @vue/cli安装 vue-cli 后重新启动终端或使用以下内容更新源: source ~/.bash_profile (或者只是重新启动终端,更容易)所以你的配置文件中的路径得到更新:)。 That fixed it for me.那为我修好了。

After installing vue-cli with npm i -g @vue/cli and update the source with something like source ~/.profile or (~/.bash_profile) .使用 npm i -g @vue/cli 安装 vue-cli 并使用类似source ~/.profile或 (~/.bash_profile)的内容更新源代码。 That worked for me.这对我有用。

I just solved this error by simply adding sudo like sudo npm update -g @vue/cli #OR sudo yarn global upgrade --latest @vue/cli我刚刚通过简单地添加sudo解决了这个错误,例如sudo npm update -g @vue/cli #OR sudo yarn global upgrade --latest @vue/cli

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

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