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

stueynet's avatar

Forge uses different version of node than the server does through ssh

When sshing into the server, the command node -v produces

v5.0.0

However when checking the version run during the forge deploy process, it shows:

v0.12.8

This is causing problems when deploying through forge, forcing us to deploy manually from the command line. Anyone else have this issue?

0 likes
3 replies
stueynet's avatar

Digging a little deeper. It seems the server is using:

/home/forge/.nvm/versions/node/v5.0.0/bin/node

While forge is using

/usr/bin/node
adammench's avatar

I'm having this issue. Did you find a solution to tell Forge to use a newer version of Node? I have installed nvm and when ssh'ing in it says I am using

v10.8.0

however if I run node -v in my deploy script it says

v8.6.0
szibilianu's avatar

As I was stuck with this issue, I decided to necro this thread to post an answer. In my example, I use nvm to control node version.

Requires installation of nvm on server before deploy. If we don't tell Forge which node/nvm to use, it will use the Node located in /usr/bin/node. This is done by reading and executing (source or dot operator .) nvm file to launch it

. ~/.nvm/nvm.sh

Select the project's Node version

nvm use X.X.X

Install production (non-dev) project dependencies

npm install --production

Run compiling script

npm run prod

1 like

Please or to participate in this conversation.