Skip to content

Instantly share code, notes, and snippets.

@nmvuong92
Last active September 3, 2018 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmvuong92/4018aa7d62c89d2b9618526990992dea to your computer and use it in GitHub Desktop.
Save nmvuong92/4018aa7d62c89d2b9618526990992dea to your computer and use it in GitHub Desktop.
Tạo mới reactjs app

0 cài đặt gói app-create-app cli để tạo ứng dụng reactjs chính thống từ trang chủ*

npm install -g create-react-app

1 KIỂM TRA ĐÃ CÀI ĐẶT create-react-app chưa?

create-react-app -V

=>1.5.2

2 Tạo ứng dụng reactjs mới có tên my-first-reactjs

create-react-app my-first-reactjs

3 Chạy ứng dụng reactjs

set port để chạy vào my-first-reactjs/package.json sửa như phía dưới trong đó 4044 là số nguyên là cổng khuyến khích 4 số để chạy

{
 "scripts": {
    "start": "set PORT=4044 && react-scripts start"
}
}

4 sau đó chạy dòng lệnh ở cmd trong thư mục my-first-reactjs như ở dưới => sẽ tự động chạy ứng dụng trên localhost:4044

npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment