![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/local/n/versions/node/14.15.4/lib/node_modules/npm/docs/content/cli-commands/ |
Upload File : |
--- section: cli-commands title: npm-uninstall description: Remove a package --- # npm-uninstall(1) ## Remove a package ### Synopsis ```bash npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save] aliases: remove, rm, r, un, unlink ``` ### Description This uninstalls a package, completely removing everything npm installed on its behalf. Example: ```bash npm uninstall sax ``` In global mode (ie, with `-g` or `--global` appended to the command), it uninstalls the current package context as a global package. `npm uninstall` takes 3 exclusive, optional flags which save or update the package version in your main package.json: * `-S, --save`: Package will be removed from your `dependencies`. * `-D, --save-dev`: Package will be removed from your `devDependencies`. * `-O, --save-optional`: Package will be removed from your `optionalDependencies`. * `--no-save`: Package will not be removed from your `package.json` file. Further, if you have an `npm-shrinkwrap.json` then it will be updated as well. Scope is optional and follows the usual rules for [`scope`](/using-npm/scope). Examples: ```bash npm uninstall sax --save npm uninstall @myorg/privatepackage --save npm uninstall node-tap --save-dev npm uninstall dtrace-provider --save-optional npm uninstall lodash --no-save ``` ### See Also * [npm prune](/cli-commands/npm-prune) * [npm install](/cli-commands/npm-install) * [npm folders](/configuring-npm/folders) * [npm config](/cli-commands/npm-config) * [npmrc](/configuring-npm/npmrc)