Hi
I installed nodejs via
Node
Package
Manager (n
pm) and could execute
npx command via TProcess.
Recently I installed node via
Node
Version
Manager (n
vm) and now the TProcess reports it cannot find the command
npx.
But I can execute the TProcess npx when my application is opened via a terminal window, rather then clicking the Desktop icon.
So I suspect the problem is to do with how linux sets environment-variables/paths but I haven't been able to get it working.
I noticed nvm modifies my
~./bashrc file, and the lazarus documentation says this will not be loaded
https://wiki.freepascal.org/Executing_External_Programs and .bashrc is not read by non-interactive shells unless you set the BASH_ENV environment variableHow do I set the BASH_ENV variable?, should I do this with another TProcess, or somehow configure my existing TProcess (pipe?) ?
Or maybe there is another solution? Maybe modify the contents of a different system file in the same way ~./bashrc has been modified?
Note I have this working on windows by setting executable to 'c:\windows\system32\cmd.exe' and using /c with npx as a parameter. I tried similar with linux using '/bin/bash' and 'bin/sh' but no luck.
Maybe I'm close to a solution but just not the right combination of modifications..
Thanks,
Mike