I recently migrated from using node installed on my Ubuntu server to using NVM to manage my node, but the issue is the application I use on this server uses a .service
file that executes with the path of the locally installed node, usr/bin/node
. I have fixed this configuration by using the NVM path, but the issue with this is that the server node version can change (e.g. when updating my application with a newer node version). Because of this is there a good way to either symlink or insert some dynamic insertion as a part of the path?
Line:
ExecStart=/home/ghost-mgr/.nvm/versions/node/v14.17.0/bin/node /usr/bin/ghost r$
Full File:
[Service]
Type=simple
WorkingDirectory=/var/www/ghost
User=999
Environment="NODE_ENV=production"
ExecStart=/home/ghost-mgr/.nvm/versions/node/v14.17.0/bin/node /usr/bin/ghost r$
Restart=always
[Install]
WantedBy=multi-user.target