简体   繁体   English

osx create-react-app没有安装

[英]osx create-react-app not installing

I am trying to install react using the terminal command: 我正在尝试使用terminal命令安装react:

npm install -g create-react-app npm install -g create-react-app

But it doesn't seem to be working and I get the following output: 但它似乎没有工作,我得到以下输出:

create-react-app output create-react-app输出

Does anyone know what might be the problem here? 有谁知道这可能是什么问题?

正如我在截图中看到的,您只需要使用此命令作为管理员sudo npm install -g create-react-app

In case you stumbled here because of this error: 如果你因为这个错误而在这里跌跌撞撞:

-bash: create-react-app: command not found -bash:create-react-app:命令未找到

Then you need to do this: 然后你需要这样做:

npx create-react-app yourApp

Essentially you need to prepend create-react-app with npx . 从本质上讲,你需要预先create-react-appnpx

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

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