0

I'm making a custom Terminator layout and specifying custom commands for different tabs.

Ruby on Rails commands work fine:

However my node commands do not start, and I can't determine why.

My node, npm command looks something like this:

After starting Terminator, the tab that runs npm start shows this:

-/bin/bash: npm: command not found

If I run npm start manually it starts normally.

I think this has to do with access rights or something, because when I run Terminator through the console instead of the GUI, all my custom commands start and run perfectly, including node commands.

2 Answers 2

5

I encountered a problem similar to the OPs issue (the OP tries unsuccessfully to run the npm start command in a Terminator Custom Command) when I attempted to run jupyter notebook in a Terminator Custom Command.

After some additional googling I started to think that probably this had to do with my ~/.bashrc not being loaded by Terminator on building the Layouts. I tried to source ~/.bashrc in my Terminator Custom Command (e.g. Custom command: source ~/.bashrc; jupyter notebook) but that also did not work.

Next, I located my jupyter binary file using whereis jupyter. I then used that absolute file path in my Terminator Custom Command, like absolute/path/to/jupyter notebook.

Success!

0

The command does not work because your bash profile isn't loaded when running the first command. Your second bash runs a separate shell, which is probably not what you want.

Mikhail's answer works, but you need to separately find the absolute URL for each command you want to run.

What's needed is running a command in a bash login shell, and then giving the control back to the user. From StackOverflow:

bash --rcfile <(echo '. ~/.bashrc; yarn dev')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .