提示: 如果你使用的是 npm 5.2 或更高版本,我们建议使用 npx 来全局运行包。

安装中 是一个全球包,允许你在本地计算机上将包中的代码作为一组工具使用。

要全局下载和安装包,请在命令行上运行以下命令:

🌐 To download and install packages globally, on the command line, run the following command:

npm install -g <package_name>

如果你遇到 EACCES 权限错误,你可能需要使用版本管理器重新安装 npm,或者手动更改 npm 的默认目录。更多信息,请参见“解决全局安装包时的 EACCES 权限错误”。

🌐 If you get an EACCES permissions error, you may need to reinstall npm with a version manager or manually change npm's default directory. For more information, see "Resolving EACCES permissions errors when installing packages globally".