@deron
To install React.js using NPM (Node Package Manager), you can follow these steps:
1
|
node -v |
If Node.js is not installed, you can download and install it from the official website: https://nodejs.org/
1
|
npm install react react-dom |
This command will install React.js and ReactDOM as dependencies in your project's "node_modules" directory.
1
|
npm install -g create-react-app |
1
|
create-react-app my-react-app |
Replace "my-react-app" with the name you want to give to your project.
1 2 |
cd my-react-app npm start |
This will start the development server and you can view your React application in a web browser at http://localhost:3000/
That's it! You have successfully installed React.js using NPM and created a new React project. Happy coding!