Node container can't get environment variables
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- devops
Research direction
Start by reproducing the supplied Lando configuration and Node build commands, then inspect how the Node service receives LANDO_WEBROOT during its build. Done means the environment variable resolves to the project webroot and the shown npm and cd commands complete successfully.
Written by the indexing model from the issue text.
Description
Hi,
I'm creating a dynamic build command on the lando file, so I want to use environment variables for the folders.
name: test
recipe: drupal9
config:
webroot: src/web
php: '7.4'
services:
appserver:
overrides:
environment:
DRUSH_OPTIONS_URI: "http://test.lndo.site"
node:
type: node:14
build:
- if [ -d $LANDO_WEBROOT/themes/custom/test/node_modules ]; then echo "Deleting node_modules folder" && rm -rf $LANDO_WEBROOT/themes/custom/test/node_modules; fi
- echo "lando root" $LANDO_WEBROOT
- echo "Running NPM install" && cd $LANDO_WEBROOT/themes/custom/test && npm install
- echo "Creating NPM build" && cd $LANDO_WEBROOT/themes/custom/test && npm run gulp js && npm run gulp styles
This is the output of the build of node.
lando root
Running NPM install
/bin/sh: 1: cd: can't cd to /themes/custom/test
ERROR ==> /bin/sh: 1: cd: can't cd to /themes/custom/test
It seems the node container doesn't have the environment variables set.
Thanks
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lando/node
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Add rsync Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·