No Result
View All Result
CloudReports
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner
  • 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
0
SHARES
320
VIEWS
Share on FacebookShare on Twitter

Contents

  • 1 Prerequisites
  • 2 Node.js update
    • 2.1 READ ALSO
    • 2.2 Migrate from Hot Reload to Fast Refresh
    • 2.3 Deploy Next.js to Firebase for SSR and API Route
    • 2.4 nInstallation of
    • 2.5 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.

READ ALSO

Migrate from Hot Reload to Fast Refresh

Migrate from Hot Reload to Fast Refresh

December 16, 2020
1.5k
Deploy Next.js to Firebase for SSR and API Route

Deploy Next.js to Firebase for SSR and API Route

December 15, 2020
1.7k

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.

$ 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.

ADVERTISEMENT
/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
ShareTweetShare
Previous Post

Npm module: a backdoor and ambush questions

Next Post

Migrate from Hot Reload to Fast Refresh

npn

npn

Related Posts

Migrate from Hot Reload to Fast Refresh
React

Migrate from Hot Reload to Fast Refresh

December 16, 2020
1.5k
Deploy Next.js to Firebase for SSR and API Route
React

Deploy Next.js to Firebase for SSR and API Route

December 15, 2020
1.7k
How to use React Hook: useState
React

How to use React Hook: useState

December 15, 2020
432
The interest of next/image from Next.js 10
React

The interest of next/image from Next.js 10

December 15, 2020
596
The story of migrating 70,000 lines of JavaScript code to TypeScript
Javascript

The story of migrating 70,000 lines of JavaScript code to TypeScript

December 15, 2020
508
AntD Basic layout – Create Website layout with Ant Design
Layout and Routing

AntD Basic layout – Create Website layout with Ant Design

September 23, 2020
5.1k
Next Post
Migrate from Hot Reload to Fast Refresh

Migrate from Hot Reload to Fast Refresh

Discussion about this post

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

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)
No Result
View All Result
  • Home
  • Linux
  • Web development
  • Javascript
  • SQL
  • Ant Design tutorial
  • QR Code Scanner