{"id":795,"date":"2023-01-09T09:00:00","date_gmt":"2023-01-09T09:00:00","guid":{"rendered":"https:\/\/www.naveedulhaq.com\/?p=795"},"modified":"2023-03-11T13:03:13","modified_gmt":"2023-03-11T13:03:13","slug":"npm-commands-cheat-sheet","status":"publish","type":"post","link":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/","title":{"rendered":"npm Commands Cheat Sheet"},"content":{"rendered":"\n<p>Below are the most common commands used in npm (Node Package Manager)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install npm &amp; dependencies<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install npm with the version<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>nvm install 12<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install Jest Global<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g jest<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Delete previous &amp; new installation<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -rf node_modules &amp;&amp; npm install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install SASS<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install gulp gulp-sass sass --save-dev<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install Axios<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install axios --save<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install package<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm i &lt;package&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Uninstall package<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm un &lt;package&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Remove node_modules and re-installing<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>rm -rf node_modules\nrm -rf package-lock.json\nnpm install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Update package<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm up &lt;package&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Global install package<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm list -g --depth=0\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Uninstall a global package<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm -g uninstall &lt;name&gt; \n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Upgrade npm<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>npm-windows-upgrade\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below are the most common commands used in npm (Node Package Manager) Install npm &amp; dependencies Install npm with the version Install Jest Global Delete&#8230;<\/p>\n","protected":false},"author":1,"featured_media":805,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,14,94],"tags":[32],"class_list":["post-795","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-js","category-misc","category-npm-git","tag-developer"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"og:description\" content=\"Below are the most common commands used in npm (Node Package Manager) Install npm &amp; dependencies Install npm with the version Install Jest Global Delete...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/\" \/>\n<meta property=\"og:site_name\" content=\"Naveed Ul-Haq&#039;s blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-09T09:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-11T13:03:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png\" \/>\n\t<meta property=\"og:image:width\" content=\"298\" \/>\n\t<meta property=\"og:image:height\" content=\"305\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Naveed Ul-Haq\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Ul-Haq\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/\"},\"author\":{\"name\":\"Naveed Ul-Haq\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"headline\":\"npm Commands Cheat Sheet\",\"datePublished\":\"2023-01-09T09:00:00+00:00\",\"dateModified\":\"2023-03-11T13:03:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/\"},\"wordCount\":57,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/npm.png\",\"keywords\":[\"developer\"],\"articleSection\":[\"JS\",\"Misc\",\"npm &amp; git\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/\",\"name\":\"npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/npm.png\",\"datePublished\":\"2023-01-09T09:00:00+00:00\",\"dateModified\":\"2023-03-11T13:03:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/npm.png\",\"contentUrl\":\"https:\\\/\\\/www.naveedulhaq.com\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/npm.png\",\"width\":298,\"height\":305,\"caption\":\"npm cheat sheet\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/index.php\\\/misc\\\/npm-commands-cheat-sheet\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"npm Commands Cheat Sheet\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#website\",\"url\":\"https:\\\/\\\/www.naveedulhaq.com\\\/\",\"name\":\"Naveed Ul-Haq's blog\",\"description\":\"AI, Optimizely, Azure &amp; more\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.naveedulhaq.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.naveedulhaq.com\\\/#\\\/schema\\\/person\\\/dd6db5980b965fcae41e096d357c65c9\",\"name\":\"Naveed Ul-Haq\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\",\"caption\":\"Naveed Ul-Haq\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g\"},\"description\":\"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\\\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\\\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.\",\"sameAs\":[\"https:\\\/\\\/www.naveedulhaq.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedulhaq\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog","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:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/","og_locale":"en_GB","og_type":"article","og_title":"npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog","og_description":"Below are the most common commands used in npm (Node Package Manager) Install npm &amp; dependencies Install npm with the version Install Jest Global Delete...","og_url":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/","og_site_name":"Naveed Ul-Haq&#039;s blog","article_published_time":"2023-01-09T09:00:00+00:00","article_modified_time":"2023-03-11T13:03:13+00:00","og_image":[{"width":298,"height":305,"url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png","type":"image\/png"}],"author":"Naveed Ul-Haq","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Ul-Haq","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#article","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/"},"author":{"name":"Naveed Ul-Haq","@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"headline":"npm Commands Cheat Sheet","datePublished":"2023-01-09T09:00:00+00:00","dateModified":"2023-03-11T13:03:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/"},"wordCount":57,"commentCount":0,"publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png","keywords":["developer"],"articleSection":["JS","Misc","npm &amp; git"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/","url":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/","name":"npm Commands Cheat Sheet - Naveed Ul-Haq&#039;s blog","isPartOf":{"@id":"https:\/\/www.naveedulhaq.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#primaryimage"},"image":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#primaryimage"},"thumbnailUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png","datePublished":"2023-01-09T09:00:00+00:00","dateModified":"2023-03-11T13:03:13+00:00","breadcrumb":{"@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#primaryimage","url":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png","contentUrl":"https:\/\/www.naveedulhaq.com\/wp-content\/uploads\/2023\/01\/npm.png","width":298,"height":305,"caption":"npm cheat sheet"},{"@type":"BreadcrumbList","@id":"https:\/\/www.naveedulhaq.com\/index.php\/misc\/npm-commands-cheat-sheet\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.naveedulhaq.com\/"},{"@type":"ListItem","position":2,"name":"npm Commands Cheat Sheet"}]},{"@type":"WebSite","@id":"https:\/\/www.naveedulhaq.com\/#website","url":"https:\/\/www.naveedulhaq.com\/","name":"Naveed Ul-Haq's blog","description":"AI, Optimizely, Azure &amp; more","publisher":{"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.naveedulhaq.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.naveedulhaq.com\/#\/schema\/person\/dd6db5980b965fcae41e096d357c65c9","name":"Naveed Ul-Haq","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g","caption":"Naveed Ul-Haq"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/362536aba6cc66917d7558cacd015a81c7cdf1a69b9a28c994764847c487b692?s=96&d=mm&r=g"},"description":"I lead engineering delivery teams for digital commerce and digital experience platforms, combining hands-on architecture experience with strong delivery governance. Over 20+ years, I\u2019ve built and led cross\u2011functional teams (engineering, BA, QA) delivering modern cloud solutions on Azure, microservices, APIs and eCommerce\/CMS platforms. My recent focus includes AI-enabled commerce automation: product ingestion and enrichment workflows, content optimisation for SEO and shopping feeds, and agentic tooling to improve marketing and accessibility workflows. I\u2019m passionate about building high-performing teams, establishing quality\/release standards, and delivering measurable outcomes across performance, reliability, and speed of change.","sameAs":["https:\/\/www.naveedulhaq.com","https:\/\/www.linkedin.com\/in\/naveedulhaq\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/comments?post=795"}],"version-history":[{"count":0,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/posts\/795\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media\/805"}],"wp:attachment":[{"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/media?parent=795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/categories?post=795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.naveedulhaq.com\/index.php\/wp-json\/wp\/v2\/tags?post=795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}