Home >Web Front-end >Front-end Q&A >What is the difference between npm and node.js?
Difference: 1. "node.js" is a running environment for JavaScript and a server-side JavaScript interpreter, while npm is the package manager of "node.js"; 2. npm does not require a separate Installation, "node.js" contains npm, npm will be installed together when installing node.
The operating environment of this article: Windows 10 system, nodejs version 12.19.0, Dell G3 computer.
1. node.js
Node.js is a running environment for JavaScript
node.js is an encapsulation of the Google V8 engine. It is a server-side JavaScript interpreter
A development platform that allows JavaScript to run on the server side. It makes JavaScript a scripting language on par with server-side languages such as PHP, Python, Perl, and Ruby
2. npm
npm is the package manager of node.js
When developing with Node.js, you often use other people’s JS code and need to download it regularly. , decompress and use
The method in the first article is too troublesome, so npm (package manager) appeared
Everyone uploads the written code to npm, if you need to use it The code can be downloaded directly through npm
3. The relationship between the two
The two are inclusive relationships
node.js contains npm , npm is the package manager of node.js
npm does not need to be installed separately. When installing Node, npm will be installed together
Recommended learning: "nodejs video tutorial》
The above is the detailed content of What is the difference between npm and node.js?. For more information, please follow other related articles on the PHP Chinese website!