如何在linux终端上运行创建-反应应用程序

时间:2022-08-22 20:17:34

I have installed nodejs and yarn on my computer (Linux Deepin). I have also installed create-react-app globally. However, the create-react-app command is not running. I keep getting the error: bash: create-react-app: command not found.

我在我的电脑(Linux Deepin)上安装了nodejs和纱线。我还在全球安装了create-反应式应用。但是,创建-反应-应用程序命令没有运行。我不断得到错误:bash:创建-反应-应用程序:没有找到命令。

Is there some configuration I am missing? Because I have seen the create-react-app that was installed globally.

有没有什么配置我没有?因为我看到了在全球安装的create-反应式应用。

NodeJS - v6.3.1 Yarn - 1.6.0 OS version Linux Deepin -15

NodeJS - v6.3.1纱线- 1.6.0 OS版本Linux Deepin -15

2 个解决方案

#1


2  

Add yarn global path to your path variable the following appends yarn global path to your ~/.bashrc

将纱线全局路径添加到路径变量中,如下所示将纱线全局路径添加到您的~/.bashrc中

 echo  'export PATH="$PATH:$(yarn global bin)"' >> ~/.bashrc 

if you are using other shell like zsh make sure you append to the correct file for zsh use

如果您正在使用其他shell,如zsh,请确保您附加到用于zsh的正确文件

 echo  'export PATH="$PATH:$(yarn global bin)"' >> ~/.zshrc

finally make sure you restart your terminal.

最后,确保重新启动终端。

#2


0  

Are you sure the command is already in your path?? If you just installed it, maybe, just close and relaunch terminal ;)

你确定命令已经在你的路径中了吗?如果你只是安装它,也许,只是关闭和重新启动终端;)

#1


2  

Add yarn global path to your path variable the following appends yarn global path to your ~/.bashrc

将纱线全局路径添加到路径变量中,如下所示将纱线全局路径添加到您的~/.bashrc中

 echo  'export PATH="$PATH:$(yarn global bin)"' >> ~/.bashrc 

if you are using other shell like zsh make sure you append to the correct file for zsh use

如果您正在使用其他shell,如zsh,请确保您附加到用于zsh的正确文件

 echo  'export PATH="$PATH:$(yarn global bin)"' >> ~/.zshrc

finally make sure you restart your terminal.

最后,确保重新启动终端。

#2


0  

Are you sure the command is already in your path?? If you just installed it, maybe, just close and relaunch terminal ;)

你确定命令已经在你的路径中了吗?如果你只是安装它,也许,只是关闭和重新启动终端;)