You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is not a Yarn issue but I really don't know where else to look for help.
I'm trying to automatize a deployment process that requires running a npm script on the remote server.
What I've tried so far is to use a very simple make script to rsync my changes and ssh run the npm script using yarn (i.e. ssh user@remote:/path 'cd var/www/path; yarn run build'). Problem is, the PATH isn't loaded when trying to run a command via SSH without properly loading the interactive shell. So yarn run build throws a 'Yarn requires Node 4.7.0 or higher' error.
I tried sourcing the .bashrc and .bash_profile before running the command, tried using the -t flag with SSH too. Neither worked.
Is there a way to actually accomplish this? Does a workaround exists? I can't really think of other way to automatize running the 'yarn run build' command.
The text was updated successfully, but these errors were encountered:
Had the same issue when i was implementing continuous integration.
You are right about the PATH not being loaded, so it couldn't load Node. The solution is to export PATH in the command itself.
Do this on your remote machine
Export Node:
Do a 'whereis node' to find your node installation.
export the resulting folder you get before running yarn
My Result: /home/admin/.nvm/versions/node/v8.9.4/bin/node
Export Yarn
Yarn would probably be not found now and will throw an error 'bash: yarn: command not found'
Do a 'whereis yarn' to find your yarn installation.
export the resulting folder you get before running yarn
Export other Yarn dependencies
Other dependencies that are required by Yarn wont be found now.
I got something like this. /usr/bin/yarn: 2: /usr/bin/yarn: sed: not found
/usr/bin/yarn: 3: /usr/bin/yarn: readlink: not found
/usr/bin/yarn: 5: /usr/bin/yarn: uname: not found
Do a 'whereis' on every missing module and export their PATHs too.
'whereis sed' 'whereis readlink' 'whereis uname'
TL;DR
Export PATH of required modules in the command itself.
ssh user@remote:/path 'cd var/www/path; export PATH=<path/to/node>:/usr/bin:/bin; yarn run build')
I find myself having this same issue with the odd additional quirk that adding Yarn to PATH does not cause the SSH shell to recognize the Yarn command.
Hi!
I know this is not a Yarn issue but I really don't know where else to look for help.
I'm trying to automatize a deployment process that requires running a npm script on the remote server.
What I've tried so far is to use a very simple
make
script to rsync my changes and ssh run the npm script using yarn (i.e.ssh user@remote:/path 'cd var/www/path; yarn run build'
). Problem is, the PATH isn't loaded when trying to run a command via SSH without properly loading the interactive shell. Soyarn run build
throws a 'Yarn requires Node 4.7.0 or higher' error.I tried sourcing the .bashrc and .bash_profile before running the command, tried using the -t flag with SSH too. Neither worked.
Is there a way to actually accomplish this? Does a workaround exists? I can't really think of other way to automatize running the 'yarn run build' command.
The text was updated successfully, but these errors were encountered: