如何使用Create react app安装React
How to use Create react app to install React
您好,我真的是 React 的新手,我不知道如何实际安装它,也不知道我需要做什么才能在其中编写代码。我下载了 node.js 并安装了 v12.18.3 以及 NPM 6.14.6,但每次我尝试在许多网站上提到的 create-react-app 安装方法中输入命令时,我都会得到一条错误消息说:Uncaught SyntaxError: Invalid or unexpected token
。我应该直接输入节点吗?我安装了 Visual code studio,我应该以某种方式使用它吗?我看到有一个用于 create-react-app 的 github 存储库,这是否意味着我必须将它下载到我的电脑上才能 运行 呢? React 是否只有一个 CDN 我可以用来跳过所有这些?
使用以下命令让我们开始吧:
npx create-react-app <app-name>
Ex:
npx create-react-app demo-app
create-react-app是创建react app的命令。
但是不需要安装到create-react-app。
你要做的最好的事情是,
npx create-react-app <app-name-here>
这使得安装 create-react-app 使用 npx 在命令的运行时安装。
例如,
npx create-react-app my_app
试试这个。
最好的问候。
npx create-react-app name-of-app
然后按“Enter”,让魔法开始
您好,我真的是 React 的新手,我不知道如何实际安装它,也不知道我需要做什么才能在其中编写代码。我下载了 node.js 并安装了 v12.18.3 以及 NPM 6.14.6,但每次我尝试在许多网站上提到的 create-react-app 安装方法中输入命令时,我都会得到一条错误消息说:Uncaught SyntaxError: Invalid or unexpected token
。我应该直接输入节点吗?我安装了 Visual code studio,我应该以某种方式使用它吗?我看到有一个用于 create-react-app 的 github 存储库,这是否意味着我必须将它下载到我的电脑上才能 运行 呢? React 是否只有一个 CDN 我可以用来跳过所有这些?
使用以下命令让我们开始吧:
npx create-react-app <app-name>
Ex:
npx create-react-app demo-app
create-react-app是创建react app的命令。 但是不需要安装到create-react-app。
你要做的最好的事情是,
npx create-react-app <app-name-here>
这使得安装 create-react-app 使用 npx 在命令的运行时安装。
例如,
npx create-react-app my_app
试试这个。 最好的问候。
npx create-react-app name-of-app 然后按“Enter”,让魔法开始