简体   繁体   English

如何使用yarn作为初学者为ReactJS启动Server

[英]How to Start Server for ReactJS using yarn as a beginner

I started learning ReactJS today since I know some JavaScript. 我从今天开始学习ReactJS,因为我了解一些JavaScript。

Now, I want to know how I start something like this: 现在,我想知道如何开始这样的事情:

I have installed Node.js on Windows, and after that, I was able to do this: 我已经在Windows上安装了Node.js,在那之后,我能够做到这一点:

npm install -g yarn

Which gave a reply of this sort: 给出了这样的答复:

C:\Users\XXX\AppData\Roaming\npm\yarnpkg -> C:\Users\EMI\AppData\Roaming\npm\nod
e_modules\yarn\bin\yarn.js
C:\Users\XXX\AppData\Roaming\npm\yarn -> C:\Users\EMI\AppData\Roaming\npm\node_m
odules\yarn\bin\yarn.js
+ yarn@1.7.0
updated 1 package in 16.303s

From my understanding, it means that the application was installed correctly. 据我了解,这意味着该应用程序已正确安装。

How do I start the server to show a simple "Hello World" program in ReactJS using Yarn? 如何使用Yarn启动服务器以在ReactJS中显示一个简单的“ Hello World”程序?

Yarn is only a package manager. Yarn只是程序包管理器。 If you want to start a server to show a simple Hello World program, I'd suggest using something like create-react-app or write your own express server 如果要启动服务器以显示简单的Hello World程序,建议您使用诸如create-react-app之类的工具或编写自己的Express服务器

If you are starting to learn react, knowing about create-react-app is highly useful. 如果您开始学习反应,那么了解create-react-app非常有用。 YOu can visit the page for more information which has good description on how to start your hello world and much more. 您可以访问该页面以获取更多信息,该信息对如何启动您的世界打了很好的说明。

create-react-app creates a basic template for you to start learning react right away. create-react-app为您创建一个基本模板,让您立即开始学习反应。 You just need to commands, 您只需要命令,

1) npm install and, 1)npm安装,
2) npm start(which starts the server) 2)npm start(启动服务器)

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

相关问题 这个特定的 ReactJs 代码是如何执行初学者问题的? - How is this specific ReactJs code executed beginner question? 如何使用 JSON 服务器更新 ReactJS 中的数据 - How to update data in ReactJS using JSON server 如何在启动纱线时修复语法错误 - how to fix syntaxeror when start yarn 使用yarn在带有Docker的Reactjs中“安装\\ r”错误是什么意思? - What does "install\r" error mean in Reactjs with Docker using yarn? 如何使用 Yarn 在集群模式下使用 pm2 启动 next.js 应用程序? - How to start next.js app with pm2 in cluster mode using Yarn? Medusa Gatsby 电子商务服务器在纱线启动时出现错误 - Medusa Gatsby Ecommerce Server gives an error on yarn start 如何在服务器上运行reactjs(使用create-react-app) - How to run reactjs (using create-react-app) on a server 将WebSockets与ReactJS一起使用时,不知道如何在客户端上呈现服务器消息 - Using WebSockets with ReactJS, do not know how to render server message on client 如果使用 node js 和 yarn 单击按钮,我应该如何开始在 src/test/file.me 中编写代码? - How should I start writing the code in the src/test/file.me if using node js and yarn to click on a button? 如何使用 testEnvironment 作为 NodeEnvironment 启动快速服务器? - How to start an express server using testEnvironment as NodeEnvironment?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM