-bash:反应母语:命令未找到 [英] -bash: react-native: command not found

查看:282
本文介绍了-bash:反应母语:命令未找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功安装了BREW,节点4.0+,守望和流量,我收到了以下当初我NPM安装-g反应母语-CLI:

I have successfully installed brew, node 4.0+, watchman and flow, and I received the following when I do npm install -g react-native-cli:

 /Users/home/.node/bin/react-native -> /Users/home/.node/lib/node_modules/react-native-cli/index.js
 react-native-cli@0.1.5 /Users/home/.node/lib/node_modules/react-native-cli
            └── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.3.1, read@1.0.7, winston@0.8.3, utile@0.2.1)

所以,我认为应对本地-CLI已成功安装好。然而,当我反应过来跑母语,它说:

So I assume react-native-cli has been successfully installed as well. However when I run react-native, it says

 -bash: react-native: command not found

我的节点版本是4.2.1,守望3.9冲泡0.9.5(GIT 7ed6)和NPM 2.14.7

My node version is 4.2.1, watchman 3.9, brew 0.9.5 (git 7ed6) and npm 2.14.7

推荐答案

您必须确保的/ usr / local / share下/ NPM /斌是在你的 PATH 使用具有 NPM 。

You have to make sure /usr/local/share/npm/bin is in your PATH to use binaries installed with npm.

以下内容添加到您的〜/ .bashrc中

export PATH="/usr/local/share/npm/bin:$PATH"

和刷新你的shell会话。

And reload your shell session.

这篇关于-bash:反应母语:命令未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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