LinuxCommandLibrary

npm-unlink

removes a linked package

TLDR

Unlink global package

$ npm unlink -g [package]
copy
Unlink local package
$ npm unlink [package]
copy
Unlink current package globally
$ npm unlink
copy

SYNOPSIS

npm unlink [options] [packages...]

DESCRIPTION

npm unlink removes a linked package. It's the opposite of npm link, removing the symlink between packages or removing a globally linked package.
This is an alias for "npm uninstall" but is semantically used to undo npm link operations.

PARAMETERS

-g, --global

Unlink globally.
--no-save
Don't update package.json.

WORKFLOW

$ # In library directory (linked globally)
cd my-library
npm link        # Creates global link

# In project (using linked library)
cd my-project
npm link my-library  # Uses linked version

# To unlink
cd my-project
npm unlink my-library  # Remove local link

cd my-library
npm unlink -g  # Remove global link
copy

CAVEATS

Same as npm uninstall. Use -g for globally linked packages. May need to reinstall package normally afterward.

HISTORY

npm unlink was added as a semantic alias for npm uninstall, specifically for undoing npm link operations.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community