Closed thasmo closed 2 years ago
@thasmo i can replicate this, also looks like this is probably address in lando/lando#2826 so ill check that out
@pirog Seems the version is now correct but there're still some weird behaviors I encountered.
lando ssh -c "node -v"
nvm
/bin/sh: 1: /usr/share/lando/bin/lando: not found
should print v12.20.1
.
lando ssh -c "npm -v"
nvm
7.5.2
should print 7.5.2
.
lando ssh -c "nvm -v"
nvm
/bin/sh: 1: nvm: not found
should print 0.37.2
.
It seems any of those commands prepends a line with nvm
to the output, even the ones not related to nvm/node.
lando ssh -c "php -v"
nvm
PHP 7.4.11 (cli) ( ZTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.11, Copyright (c), by Zend Technologies
It also gets printed after executing lando ssh
.
I guess nvm
configured itself during installation and somehow prints the string everytime the configuration for a new login session is read/executed; but I can't find where it does that. Maybe it's still somehow connected to how lando executes the SSH commands.
Just wanted to add that I am also having this issue and have not been able to track it down either. https://devwithlando.slack.com/archives/C2XBSHX8R/p1612461534165500
@thasmo and @xaqrox circling back around to this i think we are going to revert this change since it produces some weird behavior. Looking at https://docs.platform.sh/languages/nodejs/nvm.html it seems like its a better bet to either
.environment
file as indicated in the docs above lando node
to directly invoke the node
you want
In the
platform.sh
build hooknvm
gets installed, sets up the desirednode
version defined in.nvmrc
and also defines it as the system's defaultnode
version.Running
node -v
within the service/container works fine and returnsv10.23.1
, but when runninglando node -v
via Lando tooling, the actual node version is not the one which was set usingnvm
and returnsv6.17.1
. It seems theplatform.sh
build hook and the Lando tooling commands are executed with different users.Is there anything I can do to get the desired
node
version running via Lando tooling while setting it up using theplatform.sh
build hook?.platform.app.yaml
.lando.yml