I was trying to use n in a provisioning script for a Vagrant box to install node.js. There is a really handy install script called n-install and I had decided to go with that to install any version of node.js/io.js in one line like this:
# install io.jscurl -L http://git.io/n-install | bash -s -- -y io:latestsource $HOME/.bashrc
I had to source the
.bashrc to set some environment variables for
n and add it to the
PATH. This never worked and I couldn't figure out why until I opened an issue on GitHub and found a StackOverflow post mentioning a potential issue.
The problem is that the default
.bashrc contains this line at the very top:
# If not running interactively, don't do anything[ -z "$PS1" ] && return
So the relevant lines that setup
n never get executed. I have found this to be the case for
I haven't found a way to source the
.bashrc without breaking anything, so I am going to be using a different install method for
n in the meantime. If I make a discovery, I will update this post.