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:
- 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.ymlfile:
services:
node:
type: node
globals:
npm: latest
After adding the service, you'll need to restart Lando with lando rebuild.
- 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
npmcommands directly using Lando's command prefix. For example:
lando npm install
- If you need to run
npmas part of an Artisan command, you might need to create a custom script that Lando can execute, which sets up the correct environment variables fornpmto be found. For example, you could create a script calledlando-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
- Alternatively, you can try to symlink the
npmfrom 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.