See Details
目 录
要在公共 npm 注册表或私有 npm 注册表中发布和安装包,你必须使用 Node 版本管理器或 Node 安装程序安装 Node.js 和 npm 命令行接口。我们强烈建议使用像 nvm 这样的 Node 版本管理器来安装 Node.js 和 npm。我们不建议使用 Node 安装程序,因为 Node 安装过程会将 npm 安装在具有本地权限的目录中,并且在全局运行 npm 包时可能会导致权限错误。
¥To publish and install packages to and from the public npm registry or a private npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. We strongly recommend using a Node version manager like nvm to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.
注意:要下载最新版本的 npm,请在命令行上运行以下命令:
¥Note: to download the latest version of npm, on the command line, run the following command:
npm install -g npm
概述
¥Overview
检查 npm 和 Node.js 版本
¥Checking your version of npm and Node.js
要查看你是否已经安装了 Node.js 和 npm 并检查安装的版本,请运行以下命令:
¥To see if you already have Node.js and npm installed and check the installed version, run the following commands:
node -vnpm -v