lando / lando

A development tool for all your projects that is fast, easy, powerful and liberating
https://lando.dev
GNU General Public License v3.0
4.1k stars 545 forks source link

Odd behavior for tooling when creating a command to run node in a service #3460

Open mattsmith14 opened 2 years ago

mattsmith14 commented 2 years ago

Setup

.lando.yml

name: uk-kore
proxy:
  django:
    - django.lndo.site:8000
  next:
    - nextapp.lndo.site:3000
services:
  django:
    type: python:custom
    overrides:
      image: cdk-django-deploy_local
      build:
        context: ./djangoapp
        dockerfile: ./Dockerfile
        args:
          BUILD_ENVIRONMENT: local
      user: root
      environment:
        PYTHONPATH: /app/djangoapp
        DATABASE_URL: postgres://postgres:@database.ukkore.internal:5432/django
    ssl: true
  next:
    type: node:16
    ssl: true
    overrides:
      environment:
        BACKEND_URL: https://djangoapp.lndo.site

  database:
    type: postgres:14
    portforward: true
    creds:
      user: postgres
      password: ''
      database: django

tooling:
  python:
    service: django
    cmd: python
  pip:
    service: django
    cmd: pip
  manage.py:
    service: django
    dir: /app/djangoapp
    cmd: python manage.py
  node:
    service: next
    cmd: node
    dir: /app/nextapp
  npm:
    service: next
    cmd: npm
    dir: /app/nextapp
  npx:
    service: next
    cmd: npx
    dir: /app/nextapp
  start-frontend:
    service: next
    cmd: npm run dev
    dir: /app/nextapp
  start-backend:
    service: django
    cmd: python manage.py runserver_plus 0.0.0.0:8000
    dir: /app/djangoapp

Problem Description For the tooling entry for node you receive the following error when running lando node:

/bin/sh: 1: /usr/share/lando/bin/lando: not found

I can drop into bash on the service running node and run node without an issue. Changing the tooling entry for node to use the command nodejs instead of node also works fine.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.

beaverusiv commented 1 year ago

I have fixed this in my own config by wrapping my command in a bash call: node /app/node_modules/puppeteer/install.js -> bash -c "node /app/node_modules/puppeteer/install.js"