{"id":8613,"date":"2016-01-12T23:26:24","date_gmt":"2016-01-12T23:26:24","guid":{"rendered":"https:\/\/wp.okra.host\/article\/adding-npm-bin-path-to-command-search-path\/"},"modified":"2021-03-07T14:34:00","modified_gmt":"2021-03-07T13:34:00","slug":"adding-npm-bin-path-to-command-search-path","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/adding-npm-bin-path-to-command-search-path\/","title":{"rendered":"Adding npm bin\/ path to command search path"},"content":{"rendered":"<h2 id=\"overview\" >\u00dcbersicht<\/h2>\n<p>npm installs packages by default under <code>node_modules\/<\/code> within the current working directory. Binary files, if bundled with a package, are installed under <code>node_modules\/.bin\/<\/code> unless the global (<code>-g<\/code>) flag is supplied to <code>npm-Installation<\/code>. This works if only a single version of a particular\u00a0package is installed, but fails in most multi-version setups.<\/p>\n<h2 id=\"solution\" >L\u00f6sung<\/h2>\n<p>Add <code>node_modules\/.bin\/<\/code> to your search path, called &#8220;<code>PATH\"<\/code>. <code>PATH<\/code> is a special environment variable in bash that defines the order of directories a file is searched for when executing a command.<\/p>\n<p>Simply run this command from the terminal, making note of the single-quote (&#8216;) and double-chevron (&gt;&gt;) usage:<\/p>\n<pre data-language=\"shell\"><code>echo 'PATH=$PATH:.\/node_modules\/.bin:..\/node_modules\/.bin' &gt;&gt; ~\/.bash_profile<\/code><\/pre>\n<p>Log out of the terminal and log back in.<\/p>\n<p><strong><em>Notes:\u00a0<\/em><\/strong>it is acceptable to omit ..\/node_modules\/.bin from the path. This is used for situations like <a href=\"https:\/\/kb.okra.host\/de\/node\/sails-quickstart\/\">Sails<\/a> that\u00a0create a\u00a0separate directory for its application.<\/p>\n<h2 id=\"see-also\" >Siehe auch<\/h2>\n<ul>\n<li><a href=\"http:\/\/tldp.org\/LDP\/intro-linux\/html\/sect_03_02.html\">Orientation in the file\u00a0system<\/a> (TLDP)<\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview npm installs packages by default under node_modules\/ within the current working directory. Binary files, if bundled with a package, are installed under node_modules\/.bin\/ unless the global (-g) flag is supplied to npm install. This works if only a single version of a particular\u00a0package is installed, but fails in most&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[62],"ht-kb-tag":[],"class_list":["post-8613","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-node"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8613"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8613\/revisions"}],"predecessor-version":[{"id":8614,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8613\/revisions\/8614"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8613"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8613"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}