Home >Web Front-end >JS Tutorial >Does react require node?
react does not need and does not depend on node, because react.js and node.js are not closely related; but we usually use the scaffolding provided by react to build the project structure, and this requires the use of node.
The operating environment of this article: windows7 system, react17.0.1 version, DELL G3 computer.
Do you need node to learn react?
You don’t need to install node to learn react. There is not much correlation between react.js and node.js. You can learn react.js completely independently.
But we usually use the scaffolding provided by react to build the project structure, and this requires the use of node. But node.js only needs to know its npm installation package.
1. Introduction to common tools
1. nodejs:
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
how to understand ? First of all, node.js is a JavaScript running environment. Generally, the JavaScript we know runs in the browser. So you can understand why it is based on Chrome's V8 JavaScript engine. With nodejs, you can abstract JavaScript public components and deploy them separately on nodejs to provide public services. The front-end possibilities are now more imaginative.
2. npm: (node package manager)
The node package manager mainly manages node package installation, uninstallation, updating, viewing, searching and publishing. Free developers from tedious package management work (versions, dependencies). Nodejs has integrated npm, so npm is also installed when installing nodejs.
3. nvm: node version manager
Use it to easily install and maintain multiple Node versions on the machine. So why do you need multiple versions? There are many scenarios. For example, you may be working on two projects at the same time, and the node versions used by different projects are different; or you may want to use a newer version to do some experiments. In this case, it would be troublesome to install and maintain multiple versions of node without NVM. This is the value of nvm.
4. webpack: webpack is a module bundler (webpack is a module bundler).
It is to analyze the structure of your current project, package things that the browser used in the project cannot understand (SCSS, jade, Typescript, etc.) in an appropriate way and translate them into css that the browser can understand. and js. In webpack everything is a module (images and CSS too).
Note: To learn React, you need to install nodejs. The main reason is not that React depends on nodejs, but that webpack depends on nodejs.
Related recommendations: "react video tutorial"
The above is the detailed content of Does react require node?. For more information, please follow other related articles on the PHP Chinese website!