PageSourceSearch

https://pnpm.io/assets/js/82d9ed2a.01a3f96c.js

js pnpm.io collected 2026-09-24 07:24:58 UTC 5,500 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["3513"],{80922(e,n,i){i.r(n),i.d(n,{metadata:()=>s,default:()=>p,frontMatter:()=>d,contentTitle:()=>c,toc:()=>t,assets:()=>o});var s=JSON.parse('{"id":"cli/remove","title":"pnpm remove","description":"Aliases: rm, uninstall, un","source":"@site/versioned_docs/version-11.x/cli/remove.md","sourceDirName":"cli","slug":"/cli/remove","permalink":"/11.x/cli/remove","draft":false,"unlisted":false,"editUrl":"https://github.com/pnpm/pnpm.io/edit/main/versioned_docs/version-11.x/cli/remove.md","tags":[],"version":"11.x","lastUpdatedBy":"Zoltan Kochan","lastUpdatedAt":1789071248000,"frontMatter":{"id":"remove","title":"pnpm remove"},"sidebar":"docs","previous":{"title":"pnpm update","permalink":"/11.x/cli/update"},"next":{"title":"pnpm link","permalink":"/11.x/cli/link"}}'),l=i(91987),r=i(67008);let d={id:"remove",title:"pnpm remove"},c,o={},t=[{value:"Options",id:"options",level:2},{value:"--recursive, -r",id:"--recursive--r",level:3},{value:"--global, -g",id:"--global--g",level:3},{value:"--save-dev, -D",id:"--save-dev--d",level:3},{value:"--save-optional, -O",id:"--save-optional--o",level:3},{value:"--save-prod, -P",id:"--save-prod--p",level:3},{value:"--unsafe-perm",id:"--unsafe-perm",level:3},{value:"Supply-chain policy flags",id:"supply-chain-policy-flags",level:3},{value:"--filter &lt;package_selector&gt;",id:"--filter-package_selector",level:3}];function a(e){let n={a:"a",code:"code",h2:"h2",h3:"h3",p:"p",...(0,r.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(n.p,{children:["Aliases: ",(0,l.jsx)(n.code,{children:"rm"}),", ",(0,l.jsx)(n.code,{children:"uninstall"}),", ",(0,l.jsx)(n.code,{children:"un"})]}),"\n",(0,l.jsxs)(n.p,{children:["Removes packages from ",(0,l.jsx)(n.code,{children:"node_modules"})," and from the project's ",(0,l.jsx)(n.code,{children:"package.json"}),"."]}),"\n",(0,l.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,l.jsx)(n.h3,{id:"--recursive--r",children:"--recursive, -r"}),"\n",(0,l.jsxs)(n.p,{children:["When used inside a ",(0,l.jsx)(n.a,{href:"/11.x/workspaces",children:"workspace"}),", removes a dependency (or\ndependencies) from every workspace package."]}),"\n",(0,l.jsx)(n.p,{children:"When used not inside a workspace, removes a dependency (or dependencies) from\nevery package found in subdirectories."}),"\n",(0,l.jsx)(n.h3,{id:"--global--g",children:"--global, -g"}),"\n",(0,l.jsx)(n.p,{children:"Remove a global package."}),"\n",(0,l.jsx)(n.h3,{id:"--save-dev--d",children:"--save-dev, -D"}),"\n",(0,l.jsxs)(n.p,{children:["Only remove the dependency from ",(0,l.jsx)(n.code,{children:"devDependencies"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"--save-optional--o",children:"--save-optional, -O"}),"\n",(0,l.jsxs)(n.p,{children:["Only remove the dependency from ",(0,l.jsx)(n.code,{children:"optionalDependencies"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"--save-prod--p",children:"--save-prod, -P"}),"\n",(0,l.jsxs)(n.p,{children:["Only remove the dependency from ",(0,l.jsx)(n.code,{children:"dependencies"}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"--unsafe-perm",children:"--unsafe-perm"}),"\n",(0,l.jsx)(n.p,{children:"Added in: v11.26.0"}),"\n",(0,l.jsxs)(n.p,{children:["Accepted for compatibility with ",(0,l.jsx)(n.code,{children:"pnpm install"}),"; see ",(0,l.jsx)(n.a,{href:"/11.x/settings/build#unsafeperm",children:(0,l.jsx)(n.code,{children:"unsafePerm"})}),"."]}),"\n",(0,l.jsx)(n.h3,{id:"supply-chain-policy-flags",children:"Supply-chain policy flags"}),"\n",(0,l.jsx)(n.p,{children:"Added in: v11.26.0"}),"\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"pnpm remove"})," accepts the same policy overrides as ",(0,l.jsx)(n.code,{children:"pnpm install"})," and ",(0,l.jsx)(n.code,{children:"pnpm add"}),": ",(0,l.jsx)(n.code,{children:"--trust-lockfile"}),", ",(0,l.jsx)(n.code,{children:"--no-trust-lockfile"}),", ",(0,l.jsx)(n.a,{href:"/11.x/settings/dependency-resolution#trustpolicy",children:(0,l.jsx)(n.code,{children:"--trust-policy"})}),", ",(0,l.jsx)(n.a,{href:"/11.x/settings/dependency-resolution#trustpolicyexclude",children:(0,l.jsx)(n.code,{children:"--trust-policy-exclude"})}),", and ",(0,l.jsx)(n.a,{href:"/11.x/settings/dependency-resolution#trustpolicyignoreafter",children:(0,l.jsx)(n.code,{children:"--trust-policy-ignore-after"})}),"."]}),"\n",(0,l.jsxs)(n.p,{children:["Removing a package rewrites the lockfile, so ",(0,l.jsx)(n.code,{children:"pnpm remove"})," verifies the whole lockfile against the active policies the way ",(0,l.jsx)(n.code,{children:"pnpm install"})," does, not only the entries of the package being removed. ",(0,l.jsx)(n.a,{href:"/11.x/settings/dependency-resolution#trustlockfile",children:(0,l.jsx)(n.code,{children:"--trust-lockfile"})})," skips that pass entirely."]}),"\n",(0,l.jsx)(n.h3,{id:"--filter-package_selector",children:"--filter <package_selector>"}),"\n",(0,l.jsx)(n.p,{children:(0,l.jsx)(n.a,{href:"/11.x/filtering",children:"Read more about filtering."})})]})}function p(e={}){let{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(a,{...e})}):a(e)}},67008(e,n,i){i.d(n,{R:()=>d,x:()=>c});var s=i(71763);let l={},r=s.createContext(l);function d(e){let n=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:d(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.