global Verified current stable Not installed? Package Management

Global / Install Module Globally

Install Module Globally

Installs specified modules globally using Yarn to access them system-wide.

$
Terminal
yarn global add <module_name>

When To Use

When a utility or library must be accessible across multiple projects on the system.

Pro Tip

Use the --dev flag if the module is only needed during development to save on production build size.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
yarn global add <module_name>

Anatomy of Output

Understanding the result

success Installed 1 packages. Installation Status

Confirms successful installation of the module.

info Direct dependencies: 1 Dependency Depth

Indicates the number of direct dependencies installed.

info Latest version: 1.2.3 Module Version

Shows the version of the installed module for validation.

Troubleshooting

Common pitfalls

Error: Module not found

Solution: Ensure the module name is correct or available in the repository.

Error: You don’t have permission to access /usr/local/lib/node_modules

Solution: Run the command with sudo or change ownership of the global directory.

Error: Yarn not installed

Solution: Install Yarn before attempting to use this command.

Command Breakdown

What each part is doing

yarn
Base Command
The executable that performs this operation. Here it runs Global before the shell applies any redirect operators.
<module_name>
module name
The value supplied for module name.

Alternative Approaches

Comparable commands in other tools

Alternative package management tools for the same job.