CloudReports
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
No Result
View All Result
CloudReports
No Result
View All Result
Home React

[React] React installation for Mac

npn by npn
December 16, 2020
in React
Reading Time: 3 mins read
0
[React] React installation for Mac
58
VIEWS
Share on FacebookShare on Twitter

Contents

  • 1 Prerequisites
  • 2 Node.js update
    • 2.1 nInstallation of
    • 2.2 How to use n
  • 3 install yarn
  • 4 Install create-react-app
  • 5 Create a React project
  • 6 Start React
Rate this post

Prerequisites

  • MacOS Catalina 10.15.4
  • Node.js installed

Node.js update

nThere is one of the version control methods of Node.js.
Node.js is neasy to update using commands, so ninstall.

nInstallation of

Execute the following command.

npm install -g n

How to use n

nYou can check the latest version and recommended version of Node.js.
Execute the following command.

ADVERTISEMENT
$ n --latest     # The latest version
$ n --stable     # The recommended version

Update to the recommended version. Execute the following command.

n stable

The following error may occur due to permission problem.

installing : node-v12.19.0
       mkdir : /usr/local/n/versions/node/12.19.0
mkdir: /usr/local/n/versions/node/12.19.0: Permission denied

  Error: sudo required (or change ownership, or define N_PREFIX)

In the above case sudo, execute it obediently .

sudo n stable

install yarn

npmBut it can be executed, but yarnit has more advantages, so yarninstall it.
Reference: What is npm What is yarn?

Execute the following command.

npm install -g yarn

Install create-react-app

I thought it was necessary to install it separately, but it yarnseems that it is already installed when I installed it. Was present in the
following path create-react-app.

/usr/local/bin

By the way, the above path is npmthe same as the installation location.
You can find out where to install npm with the following command:

npm bin -g

Create a React project

Start the project with the following command. The execution example is when the project name is sampleAppused.

create-react-app sampleApp

Start React

create-react-appA folder with the project name will be created in the directory where you started the React project . sampleAppA directory called the above example will be created, so move it with the following command.

cd sampleApp

Execute the following command at the move destination to start the React project.

yarn start

Success when the following screen is displayed on the browser.

Tags: macos
Previous Post

Npm module: a backdoor and ambush questions

Next Post

Migrate from Hot Reload to Fast Refresh

npn

npn

Next Post
Migrate from Hot Reload to Fast Refresh

Migrate from Hot Reload to Fast Refresh

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Categories

  • Android (1)
  • Ant Design tutorial (7)
  • App/Game (2)
  • Javascript (16)
  • Layout and Routing (2)
  • Linux (9)
  • PC & LAPTOP (6)
  • PERSONAL FINANCES (1)
  • React (13)
  • SQL (2)
  • TECHNOLOGY & DIGITAL (7)
  • The Basics (5)
  • Web development (37)

Search

No Result
View All Result
  • About Us
  • Documentation
Together We Learn!

© 2021 Cloudreports - Developer ideas, tips and stories...

No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner

© 2021 Cloudreports - Developer ideas, tips and stories...