Build failed with error "/home/render/colors.sh: line 3: tput: command not found" even appending the PATH to the current PATH

Hello, I am experiencing a build error when adding ‘/opt/render/.local/bin/:$PATH’ as my environment variable (i.e., PATH), as mentioned here: Build failed with error "/home/render/colors.sh: line 3: tput: command not found".

I have a python script in that node app that runs via child_process.

Hi there,

If you are modifying the PATH environment variable from the environment variables in our dashboard this will cause issues. The problem is that referring to other environment variables in Render environment variables, they are not expanded out, they are just text values. So setting PATH on our dashboard to /opt/render/.local/bin/:$PATH means PATH will just be /opt/render/.local/bin/:$PATH in the environment. This also results in clobbering the PATH we have already set.

Can you explain further why you need to add /opt/render/.local/bin to the path? Python is included within your NodeJS service.

Regards,

Keith
Render Support, UTC+10 :australia:

1 Like

Hello again,

I want to provide more details about the situation:

I used “pip install -r requirements.txt && npm install” because my app includes a Python script that is executed by child_process. This setup succeeded during the build process, and the service became live and worked perfectly. However, when attempting to access the endpoint that runs the script, I encountered an error similar to the one below (apologies for not having a screenshot):

Nevertheless, after re-deploying, everything is now working as expected. I’m unsure what exactly resolved the issue. Could it have been the “.profile” I created with “export PATH=”/opt/render/.local/bin:$PATH"" inside?

Thank you very much.

Hi there,

Adding .profile file wouldn’t have helped, but this file hasn’t been executed as part of your service.

I think we need to look at your service setup.

If you continue to have an issue with this, can you please open a ticket directly with us from our dashboard?

Regards,

Keith
Render Support, UTC+10 :australia: