{"componentChunkName":"component---src-pages-markdown-remark-fields-slug-js","path":"/engineering/node-package-manager-npm/","result":{"data":{"markdownRemark":{"id":"445a45cf-6c7b-5624-a656-db9212a29a67","excerpt":"the guide to NPMWhat is This, and Why Should I Care? NPM is a package manager for javascript. It is used to share and distribute code amongst the coding…","html":"<h5 id=\"the-guide-to-npmwhat-is-this-and-why-should-i-care\" style=\"position:relative;\"><a href=\"#the-guide-to-npmwhat-is-this-and-why-should-i-care\" aria-label=\"the guide to npmwhat is this and why should i care permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><img src=\"/4caf8328a2c92711c224c09a0b6c405f/the-guide-to-NPM.webp\" alt=\"the guide to NPM\">What is This, and Why Should I Care?</h5>\n<p>NPM is a package manager for javascript. It is used to share and distribute code amongst the coding community. There are over half a million packages for free developed and shared to help your JavaScript development.</p>\n<p>To discover packages click <a href=\"http://www.npmjs.com\">here</a></p>\n<h5 id=\"how-do-i-install-npm\" style=\"position:relative;\"><a href=\"#how-do-i-install-npm\" aria-label=\"how do i install npm permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How Do I Install NPM?</h5>\n<p>NPM can easily be installed by going to the node.js website. Just click on the link to download an executable file which will install the package manager for you.</p>\n<p>(If you have brew on Mac or Chocolatey on Windows installed, it is even easier just run the command:</p>\n<p>[code]brew install npm[/code]</p>\n<p>Or</p>\n<p>[code]choco install nodejs[/code]</p>\n<h5 id=\"how-do-i-install-packages\" style=\"position:relative;\"><a href=\"#how-do-i-install-packages\" aria-label=\"how do i install packages permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How Do I Install Packages?</h5>\n<p>Head over here to search for your package. Once you’ve found it, type in your console:</p>\n<p>[code]npm install -g[/code]</p>\n<p>Since NPM packages are open-source, be wary that some of the packages may not be built correctly. A good way to tell would be viewing the top of the page for any errors.</p>\n<p><img src=\"/0f0b906cfb24facfe56af23ea22ec3fd/image1.webp\"></p>\n<h5 id=\"how-do-i-keep-my-packages-up-to-date\" style=\"position:relative;\"><a href=\"#how-do-i-keep-my-packages-up-to-date\" aria-label=\"how do i keep my packages up to date permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>How Do I Keep My Packages Up-To-Date?</h5>\n<p>To update the npm packages, simply run:</p>\n<p>[code]npm update -g[/code]</p>\n<p>This will update all your outdated packages to the latest.</p>\n<h5 id=\"some-recommended-packages\" style=\"position:relative;\"><a href=\"#some-recommended-packages\" aria-label=\"some recommended packages permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Some Recommended Packages</h5>\n<ul>\n<li><a href=\"https://www.npmjs.com/package/http-server\">Http-server</a></li>\n</ul>\n<p>Detail: Emulates a web-server for client-side testing</p>\n<hr>\n<ul>\n<li><a href=\"https://www.npmjs.com/package/restify\">Restify</a></li>\n</ul>\n<p>Detail: Assists in setting up a REST APIs to test on your local server</p>\n<hr>\n<ul>\n<li><a href=\"https://www.npmjs.com/package/mocha\">Mocha</a></li>\n</ul>\n<p>Detail: Unit testing for web-development. Very useful in testing “code coverage” (It tells you where your code is not being tested in a nice HTML file)</p>\n<hr>\n<ul>\n<li><a href=\"https://www.npmjs.com/package/loginradius-sdk\">LoginRadius-SDK</a></li>\n</ul>\n<p>Detail: For existing customers, simplifies calls to our server for easy customizability</p>\n<hr>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n</style>","headings":[{"value":"the guide to NPMWhat is This, and Why Should I Care?","depth":5},{"value":"How Do I Install NPM?","depth":5},{"value":"How Do I Install Packages?","depth":5},{"value":"How Do I Keep My Packages Up-To-Date?","depth":5},{"value":"Some Recommended Packages","depth":5}],"fields":{"slug":"/engineering/node-package-manager-npm/"},"frontmatter":{"metatitle":null,"metadescription":null,"description":null,"title":"Node Package Manager (NPM)","canonical":null,"date":"August 04, 2017","updated_date":null,"tags":["NodeJs","NPM"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.5037593984962405,"src":"/static/4caf8328a2c92711c224c09a0b6c405f/2ad7f/the-guide-to-NPM.webp","srcSet":"/static/4caf8328a2c92711c224c09a0b6c405f/1c9b5/the-guide-to-NPM.webp 200w,\n/static/4caf8328a2c92711c224c09a0b6c405f/f1752/the-guide-to-NPM.webp 400w,\n/static/4caf8328a2c92711c224c09a0b6c405f/2ad7f/the-guide-to-NPM.webp 800w,\n/static/4caf8328a2c92711c224c09a0b6c405f/e7405/the-guide-to-NPM.webp 1200w,\n/static/4caf8328a2c92711c224c09a0b6c405f/16643/the-guide-to-NPM.webp 1500w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Eric Chan","github":null,"bio":"Eric is a Software Engineer at LoginRadius. Born in Hong Kong he immigrated to Vancouver in order to pursue a degree focused in Computer Science at UBC. During his spare time, Eric enjoys playing sports recreationally, as well as developing fun projects! Check out his GitHub here.","avatar":null}}}},"pageContext":{"id":"445a45cf-6c7b-5624-a656-db9212a29a67","fields__slug":"/engineering/node-package-manager-npm/","__params":{"fields__slug":"engineering"}}},"staticQueryHashes":["1171199041","1384082988","1711371485","1753898100","2100481360","229320306","23180105","528864852"]}