Fixing Bashrc Loading Issue

- 1 min

While I was working on node ‘npm link’, I need to source ~/.bashrc everytime if I want my new npm link to work (even if I already got NODE_PATH in the bashrc file), it turned out to be a bashrc setting problem.

The fix is simple:

Add this snippet in ~/.bash_profile:

[[ -s ~/.bashrc ]] && source ~/.bashrc

The reason why this issue happened:
Terminal opens a login shell. This means, ~/.bash_profile will get executed, instead of ~/.bashrc.

stackoverflow link

comments powered by Disqus
rss facebook twitter github youtube mail spotify instagram linkedin google pinterest medium vimeo stackoverflow codepen