Cannot remove part of $PATH I trying to fix any problem I have in brew doctor, so I see:

Warning: Some directories in your path end in a slash.
Directories in your path should not end in a slash. This can break other
doctor checks. The following directories should be edited:
    /usr/local/Cellar/node/5.0.0/bin/


I look into ~/.profile, ~/.bash_profile, /etc/paths – and don't see this path.

There is no files in /etc/paths.d/ folder that contains this string.

So where this $PATH part from?
From your question it sounds like the problem is a directory ending in a /. And it sounds like Homebrew is telling you the directory causing the error is /usr/local/Cellar/node/5.0.0/bin/. If this is the case then you simply need to remove the trailing / from this directory.

But it also sounds like you are saying you don't see this problem directory in your $PATH. Running echo $PATH will show you which directories are in your PATH. If your PATH contains a lot of directories as mine does, this can be a little hard to read. So maybe you are just overlooking it?

In any case, here is a simple script to show you all the directories in your PATH; 1 per line. 

#!/bin/bash

# save IFS to a variable    
old_IFS=${IFS$' \t\n'}

#set IFS to a colon
IFS=':'

for item in ${PATH[@]}
do 
    echo $item
done

# set IFS back to the default setting
IFS=$old_IFS


Or if you prefer copy and paste directly in your terminal:

old_IFS=${IFS-$' \t\n'}; IFS=':'; for item in ${PATH[@]}; do echo $item; done; IFS=$old_IFS


Or an even simpler way as pointed out by fd0 in the comments:

tr -s ':' '\n' &lt;&lt;&lt;"$PATH"


This also has the added advantage of not needing to mess around with IFS.

Using any of the above scripts, if you find a line ending in a / then you've found the culprit.