Mac OS:安装vue cli可以正常工作 [英] Mac OS : Install vue cli does work properly

查看:283
本文介绍了Mac OS:安装vue cli可以正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了vue-cli,并运行以下命令:

I installed vue-cli running the following command:

npm install -g @vue/cli
/Users/me/npm/bin/vue -> /Users/me/npm/lib/node_modules/@vue/cli/bin/vue.js
/Users/me/npm/lib
└── @vue/cli@3.0.0-rc.3 


当我运行vue init时,出现错误:找不到命令":


When I run vue init, get an the error: "command not found":

vue init webpack vue-app
-bash: vue: command not found

vue-cli似乎不在我的PATH中.当我检查PATH时,它包含目录/Users/me/npm/lib.这是echo $ PATH

vue-cli does not seem to be in my PATH. When I check the PATH, it includes the directory /Users/me/npm/lib. Here is the result of echo $PATH

/usr/local/git/bin:/Users/me/npm/bin/ng:/Users/me/npm/lib:/usr/bin/local/bin:/Users/me/.rbenv/shims:/Users/me/.rbenv/shims:/usr/local/git/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/ImageMagick/bin:/Users/me/Tools/apache-maven-3.2.5/bin


我想念什么?


What am I missing?

推荐答案

您可以尝试将其添加到您的$PATH:

You could try adding this to your $PATH:

/Users/me/npm/bin

您的$PATH当前比这更深一层,在这种情况下,您将看不到bin的内容.

Your $PATH currently goes one level deeper than this, in which case wouldn’t see the content of bin.

这篇关于Mac OS:安装vue cli可以正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆