Tip: If you are using npm 5.2 or higher, we recommend using npx to run packages globally.

Installing a package globally allows you to use the code in the package as a set of tools on your local computer.

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

npm install -g <package_name>

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".

Edit this page on GitHub
1 contributormona
Last edited by mona on March 21, 2023
声明:npm 及相关 logo 的版权归 npmjs.com 所有。本站点仅用于 npm 中文文档,与 npmjs.com 没有任何关系。由于译者水平有限,且避免产生误解,条款和政策内容不进行翻译,关于这部分,请移步官网查看最新内容。