Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Pixelairport's avatar

Filament Problem with Lando

Hi. I use Lando (https://lando.dev/) and Filament. Everything works, but one thing does not. If you do

lando artisan make:filament-theme my-form

I get an error:

sh: 1: npm: not found
Node.js is not installed. Please install before continuing.

But node is installed. I also can do lando npm and it works. But via artisan there is a problem. Can anybody help with this?

0 likes
1 reply
LaryAI's avatar
Level 58

It seems like the issue you're encountering is related to the environment in which the artisan command is being executed. When you run lando artisan make:filament-theme my-form, it's trying to execute npm, but it can't find it because npm might not be available in the shell environment that Lando is using to run the Artisan command.

To resolve this issue, you can try the following steps:

  1. Ensure that Node.js and npm are installed globally in your Lando environment. You can do this by adding Node.js service to your .lando.yml file:
services:
  node:
    type: node
    globals:
      npm: latest

After adding the service, you'll need to restart Lando with lando rebuild.

  1. Once you have Node.js and npm available in your Lando environment, you can try running the Artisan command again. If it still doesn't work, you might need to run npm commands directly using Lando's command prefix. For example:
lando npm install
  1. If you need to run npm as part of an Artisan command, you might need to create a custom script that Lando can execute, which sets up the correct environment variables for npm to be found. For example, you could create a script called lando-artisan.sh:
#!/bin/bash
export PATH=$PATH:/path/to/your/npm
php artisan "$@"

Make sure to replace /path/to/your/npm with the actual path to your npm executable within the Lando environment. Then, make the script executable:

chmod +x lando-artisan.sh

And use it to run your Artisan commands:

./lando-artisan.sh make:filament-theme my-form
  1. Alternatively, you can try to symlink the npm from your Lando service to a location that's in the PATH when running Artisan commands. You can do this by entering the Lando service shell and creating the symlink:
lando ssh
ln -s /usr/local/bin/npm /bin/npm

After creating the symlink, exit the shell and try running the Artisan command again.

Remember that after making changes to your .lando.yml file or any configuration, you should restart Lando to apply the changes. If none of these solutions work, you may want to check the Lando and Filament documentation or reach out to their support communities for more specific guidance.

Please or to participate in this conversation.