Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stueynet's avatar

Running things when ssh'd versus via the forge deploy script

I have nvm running my DO server managed by forge. I have node installed via nvm. When I run commands after sshing into the server with the forge user, it shows me that I am operating out of nvm. For example:

$ which node
/home/forge/.nvm/versions/node/v6.6.0/bin/node

$ which yarn
/home/forge/.nvm/versions/node/v6.6.0/bin/yarn

This is desired. However the forge deploy scripts do not use the same things. When I run the deploy scripts they are using:

which node
/usr/bin/node

First off why is this? And second how would I adjust the server so everything is running the correct version of the things.

Thanks!

0 likes
2 replies
ahuggins's avatar

In Forge you can edit the deploy script to do what you need.

willvincent's avatar

You could probably just add nvm use v6.6.0 to the beginning of the deploy script.

Please or to participate in this conversation.