{"id":2349,"date":"2022-11-02T23:18:49","date_gmt":"2022-11-02T22:18:49","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=2349"},"modified":"2022-11-02T23:18:49","modified_gmt":"2022-11-02T22:18:49","slug":"npm-root-global-node_modules","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2022\/11\/02\/npm-root-global-node_modules\/","title":{"rendered":"npm root &#038; global node_modules"},"content":{"rendered":"\n<p>with <em><strong>npm root<\/strong><\/em> command, we can \u00a0locates the local and global\u00a0<code>node_modules<\/code>\u00a0directory.<\/p>\n\n\n\n<p>Finding local dependencies isn&#8217;t very spectacular because they&#8217;re usually located in\u00a0<code>.\/node_modules<\/code>. But locating the global dependencies can be a hassle. People install Node.js in countless ways, and that&#8217;s why the Node.js binary and the global dependencies can be anywhere.<\/p>\n\n\n\n<p>fortunately, there&#8217;s a command that helps locate the global dependencies : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>npm root -g <\/code><\/pre>\n\n\n\n<p><em><span class=\"has-inline-color has-luminous-vivid-orange-color\">But what now, if we want to change the location ? <\/span><\/em><\/p>\n\n\n\n<h4>How To Change Global Node Modules Folder Path<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>npm config set prefix \"&lt;desired folder path>\"<\/code><\/pre>\n\n\n\n<p><strong>For example:<\/strong>\u00a0<span class=\"has-inline-color has-vivid-cyan-blue-color\"><em>npm config set prefix &#8220;<strong>c:\\brice<\/strong><\/em><\/span>\\<span class=\"has-inline-color has-vivid-cyan-blue-color\"><em><strong>node_modules<\/strong><\/em>&#8220;,<\/span><\/p>\n\n\n\n<p>From the next time onward, every global installation will save the node modules in &#8220;c:\\brice\\node_modules&#8221; folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>with npm root command, we can \u00a0locates the local and global\u00a0node_modules\u00a0directory. Finding local dependencies isn&#8217;t very spectacular because they&#8217;re usually located in\u00a0.\/node_modules. But locating the global dependencies can be a hassle. People install Node.js in countless ways, and that&#8217;s why the Node.js binary and the global dependencies can be anywhere. fortunately, there&#8217;s a command that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[145,453],"tags":[626,328,627,628,161,210],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2349"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2349"}],"version-history":[{"count":1,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2349\/revisions"}],"predecessor-version":[{"id":2350,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2349\/revisions\/2350"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/2048"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}