{"id":29401,"date":"2021-03-01T09:40:27","date_gmt":"2021-03-01T17:40:27","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=29401"},"modified":"2021-03-29T04:20:55","modified_gmt":"2021-03-29T11:20:55","slug":"npm-uninstall","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/","title":{"rendered":"Getting Started with npm uninstall"},"content":{"rendered":"\n<p>With any well designed software, there must be a way to not only install the software, but to uninstall it from your machine. Node Package Manager, or npm, offers a simple command to achieve this. Using the npm uninstall command will uninstall the specific package either from the current project\u2019s<a href=\"https:\/\/careerkarma.com\/blog\/npm-init\/\"> package.json<\/a> file, or globally.&nbsp;<br><\/p>\n\n\n\n<p>Most of the time, packages will be installed locally inside the current project\u2019s directory. This means in order to install and uninstall these packages, you must change directories in the command line until you\u2019re in the desired project. Uninstalling a global package can be done from any directory in the command line with a &#8211;global flag.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to Use npm uninstall<\/h2>\n\n\n\n<p>Calling the npm uninstall command from the project\u2019s directory will uninstall the package and remove the package from the project\u2019s package.json file. As a review, a package.json file is a file, written in JSON that keeps track of the project\u2019s packages. Removing a package from the file using npm uninstall will cause the project to stop using that package in the scope of the project.&nbsp;<br><\/p>\n\n\n\n<p>Packages can locally or globally be installed. Most packages will be locally installed, meaning it is only available to the project in which it is installed. Globally installed packages are available to any project.&nbsp;<br><\/p>\n\n\n\n<p>The npm package itself is an example of a global package. The command npm uninstall can be used in any project without having to install npm over again. Uninstalling packages can be done by calling the npm uninstall command followed by the package name.&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>npm uninstall &lt;package name&gt;<\/pre><\/div>\n\n\n\n<p>Using this syntax in the command line will uninstall the package specified. Doing so will remove that package from the package.json folder of the current project. If any other project uses this package, it will not be affected.&nbsp;<br><\/p>\n\n\n\n<p>npm uninstall accepts three optional flags:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>&#8211;save or -S: removes the package from dependencies&nbsp;<\/li><li>&#8211;save-dev or -D: removes from devDependencies<\/li><li>&#8211;save-optional or -O: removes from optionalDependencies<\/li><\/ol>\n\n\n\n<p>Remember, these flags are optional. Most of the time, you\u2019ll simply use the command followed by the package name alone.&nbsp;<br><\/p>\n\n\n\n<p>To uninstall a global package, use the &#8211;global or &#8211;g flag. Let\u2019s say that you\u2019ve been using React for years and want to use a different frontend library. To uninstall the create-react-app package from your computer completely, you\u2019d use this command:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>npm uninstall create-react-app --global<\/pre><\/div>\n\n\n\n<p>or&nbsp;<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>npm uninstall create-react-app -g<\/pre><\/div>\n\n\n\n<p>This will uninstall the package and remove anything npm installed on its behalf.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Using the npm uninstall command in your CLI is a safe and quick way to remove the package and anything else npm installed related to it. It provides a way to clean up any unused packages either inside a current project or from your entire computer. When uninstalling a package from your computer, don\u2019t forget to use the &#8211;global or &#8211;g flag.&nbsp;<br><\/p>\n\n\n\n<p>Including optional flags at the end of the uninstall command will remove the package only from those specific dependency files. This provides a little more control over uninstalling when needed. In general, using the simple syntax of npm uninstall &lt;package name&gt; will be the most common use case.<\/p>\n","protected":false},"excerpt":{"rendered":"With any well designed software, there must be a way to not only install the software, but to uninstall it from your machine. Node Package Manager, or npm, offers a simple command to achieve this. Using the npm uninstall command will uninstall the specific package either from the current project\u2019s package.json file, or globally.&nbsp; Most&hellip;","protected":false},"author":104,"featured_media":11907,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11933],"tags":[],"class_list":{"0":"post-29401","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"JavaScript","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Getting Started with npm uninstall | Career Karma<\/title>\n<meta name=\"description\" content=\"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/npm-uninstall\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting Started with npm uninstall\" \/>\n<meta property=\"og:description\" content=\"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/npm-uninstall\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-01T17:40:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-29T11:20:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ryan Manchester\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ryan Manchester\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/\"},\"author\":{\"name\":\"Ryan Manchester\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/92fd52a503f77fc058ec2d0666da9bd5\"},\"headline\":\"Getting Started with npm uninstall\",\"datePublished\":\"2021-03-01T17:40:27+00:00\",\"dateModified\":\"2021-03-29T11:20:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/\"},\"wordCount\":541,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/JavaScript.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/\",\"name\":\"Getting Started with npm uninstall | Career Karma\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/JavaScript.jpg\",\"datePublished\":\"2021-03-01T17:40:27+00:00\",\"dateModified\":\"2021-03-29T11:20:55+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/92fd52a503f77fc058ec2d0666da9bd5\"},\"description\":\"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#primaryimage\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/JavaScript.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/02\\\/JavaScript.jpg\",\"width\":1000,\"height\":667},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/npm-uninstall\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/javascript\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Getting Started with npm uninstall\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/#\\\/schema\\\/person\\\/92fd52a503f77fc058ec2d0666da9bd5\",\"name\":\"Ryan Manchester\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/ryan-manchester-150x150.jpg\",\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/ryan-manchester-150x150.jpg\",\"contentUrl\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/ryan-manchester-150x150.jpg\",\"caption\":\"Ryan Manchester\"},\"description\":\"Ryan is a technical writer at Career Karma, where he covers programming languages, technology, and web development. The Texas native earned his Bachelor's of Music Composition from the University of North Texas. Ryan is currently pursuing further education in web development, aiming to graduate from Flatiron School with a certification in full stack web development. Since joining the Career Karma team in November 2020, Ryan has used his expertise to cover topics like React and Ruby on Rails.\",\"sameAs\":[\"http:\\\/\\\/www.ryanmanchester.info\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ryan-manchester-6537a630\\\/\"],\"url\":\"https:\\\/\\\/careerkarma.com\\\/blog\\\/author\\\/ryan-manchester\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Getting Started with npm uninstall | Career Karma","description":"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/","og_locale":"en_US","og_type":"article","og_title":"Getting Started with npm uninstall","og_description":"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.","og_url":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2021-03-01T17:40:27+00:00","article_modified_time":"2021-03-29T11:20:55+00:00","og_image":[{"width":1000,"height":667,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg","type":"image\/jpeg"}],"author":"Ryan Manchester","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"Ryan Manchester","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/"},"author":{"name":"Ryan Manchester","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/92fd52a503f77fc058ec2d0666da9bd5"},"headline":"Getting Started with npm uninstall","datePublished":"2021-03-01T17:40:27+00:00","dateModified":"2021-03-29T11:20:55+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/"},"wordCount":541,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/npm-uninstall\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/","url":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/","name":"Getting Started with npm uninstall | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg","datePublished":"2021-03-01T17:40:27+00:00","dateModified":"2021-03-29T11:20:55+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/92fd52a503f77fc058ec2d0666da9bd5"},"description":"The npm uninstall command uninstalls packages from your project and removes it from the package.json file. Start learning about npm uninstall in this primer.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/npm-uninstall\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/02\/JavaScript.jpg","width":1000,"height":667},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/npm-uninstall\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/careerkarma.com\/blog\/javascript\/"},{"@type":"ListItem","position":3,"name":"Getting Started with npm uninstall"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/92fd52a503f77fc058ec2d0666da9bd5","name":"Ryan Manchester","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/12\/ryan-manchester-150x150.jpg","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/12\/ryan-manchester-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/12\/ryan-manchester-150x150.jpg","caption":"Ryan Manchester"},"description":"Ryan is a technical writer at Career Karma, where he covers programming languages, technology, and web development. The Texas native earned his Bachelor's of Music Composition from the University of North Texas. Ryan is currently pursuing further education in web development, aiming to graduate from Flatiron School with a certification in full stack web development. Since joining the Career Karma team in November 2020, Ryan has used his expertise to cover topics like React and Ruby on Rails.","sameAs":["http:\/\/www.ryanmanchester.info\/","https:\/\/www.linkedin.com\/in\/ryan-manchester-6537a630\/"],"url":"https:\/\/careerkarma.com\/blog\/author\/ryan-manchester\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/29401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=29401"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/29401\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/11907"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=29401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=29401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=29401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}