安装 node.JS 时,node.js 运行时和 npm 包管理器选项有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41675848/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between node.js runtime and npm package manager options while installing node.JS?
提问by Lijin Durairaj
I am trying to install node.js by downloading the .exe file, I am confused and stuck on the Node.js setup where in it asks to install node.js runtimeor npm package managerso I want to proceed through the installation after knowing fully the difference between the two.
我正在尝试通过下载 .exe 文件来安装 node.js,我很困惑并停留在 Node.js 设置上,其中要求安装node.js 运行时或npm 包管理器,所以我想在知道后继续安装完全是两者的区别。
My question is what is the difference between node.js runtime and npm pacakage manager and what are all the features do I get on the two options.
我的问题是 node.js 运行时和 npm pacakage 管理器之间有什么区别,以及我在这两个选项上获得的所有功能是什么。
My basic purpose of installing node.js is to compile Typescript, Please help me to understand the features of the two package

回答by soueuls
First of all, it does not ask you to install Node.js runtime OR npm package manager, it offers you to install them both (if you want)
首先,它不会要求您安装 Node.js 运行时或 npm 包管理器,它会提供您安装它们(如果需要)
Now, Node.js runtime is basically what will understand your javascript code and execute it to produce a result.
现在,Node.js 运行时基本上可以理解您的 javascript 代码并执行它以产生结果。
Npm package manager is a tool which will allow you to install third party libraries (other people's code) by using the command line.
Npm 包管理器是一个工具,它允许您使用命令行安装第三方库(其他人的代码)。
npm install express
will install the framework called express for example.
例如,将安装名为 express 的框架。
回答by bat
- Node and Nodejs are the same. Interchangeable names for the same thing. Unless someone is talking about graph theory, trees or data structures.
- Nvm is a Nodejs version manager. It let's you easily install and switch between versions. It retains globally installed packages for each version.
- Npm is a package manager. It let's you install software (libraries, plugins, frameworks and applications). Typically this software is installed to build Node applications. Sometimes it isn't.
- Node 和 Nodejs 是一样的。同一事物的可互换名称。除非有人在谈论图论、树或数据结构。
- Nvm 是一个 Nodejs 版本管理器。它让您轻松安装和在版本之间切换。它为每个版本保留全局安装的包。
- Npm 是一个包管理器。它让您安装软件(库、插件、框架和应用程序)。通常安装此软件来构建 Node 应用程序。有时不是。
Put more simply. Npm depends on Node. Nvm installs Node.
说得简单点。Npm 依赖于 Node。Nvm 安装节点。
回答by ArunValaven
Node JS
节点JS
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.
Real-Time services (Chat, Games etc)
Node.js 是一个基于 Chrome 的 JavaScript 运行时构建的平台,用于轻松构建快速、可扩展的网络应用程序。
实时服务(聊天、游戏等)
NPM
新产品管理
Npm is a package manager. Typically this software is installed to build Node applications.
It let's you install software (libraries, plugins, frameworks and applications).
Npm 是一个包管理器。通常安装此软件来构建 Node 应用程序。
它让您安装软件(库、插件、框架和应用程序)。
回答by AHAMED AAQIB
Node.jsor Nodeis an open-source, cross-platform, JavaScript runtime environment(JSRE) that executes JavaScript code outside of a web browser.
Node.js或者Node是一个开源、跨平台的 JavaScript 运行时环境 (JSRE),它在 Web 浏览器之外执行 JavaScript 代码。
npmis a package manager(like Nugetpackage manager in .NET -Microsoft ) for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js.
npm是NugetJavaScript 编程语言的包管理器(类似于.NET -Microsoft 中的包管理器)。它是 JavaScript 运行时环境的默认包管理器Node.js。
You can differentiate them by finding their version using below code.
您可以通过使用以下代码查找它们的版本来区分它们。
node --version
npm --version

