---
title: "Adding npm bin/ path to command search path"
date: "2016-01-12"
category: "node"
slug: "adding-npm-bin-path-to-command-search-path"
---

When npm installs packages locally (without the `-g` flag), binaries are placed in `node_modules/.bin/` within the current working directory. To run these binaries directly from the terminal, you need to add this path to your shell's `PATH` environment variable.

## Solution

Run the following command from the [[accessing-terminal]]:

echo 'PATH=$PATH:./node\_modules/.bin:../node\_modules/.bin' >> ~/.bash\_profile

Log out of the terminal and log back in for the change to take effect.

**Note:** The `../node_modules/.bin` portion is optional. It is useful in situations where an application creates a subdirectory for its project, such as [[sails-quickstart]].

## See Also

- [Orientation in the file system](http://tldp.org/LDP/intro-linux/html/sect_03_02.html) (TLDP)
