$ npm install -g create-react-app
$ create-react-app <project name>
$ cd <project name>
$ npm start
http://localhost:3000/
app.js
file, and so on.# to install node.js we need CURL $ sudo apt install -y curl # install node.js using apt package manager $ sudo apt update & sudo apt upgrade -y $ sudo apt install nodejs $ nodejs -v $ sudo apt install npm $ npm -v # using PPA $ curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh # version 18.x $ sudo bash nodesource_setup.sh $ sudo apt-get install nodejs $ sudo apt-get install build-essential
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash $ source ~/.bashrc $ nvm list-remote $ nvm install <version> $ nvm list $ nvm use <version>
$ npm install -g npm@latest $ npm -v
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Hello React!</title> <script src="https://unpkg.com/react@16/umd/react.development.js"></script> <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> <script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script> </head> <body> <div id="root"></div> <script type="text/babel"> class App extends React.Component { render() { return <h1>Hello world!</h1> } } ReactDOM.render(<App />, document.getElementById('root')) </script> </body> </html>