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

caiquecastro's avatar

Envoy not running npm

I use envoy to deploy my laravel application. In one of the tasks, I run the yarn command to download my front-end dependencies. When I run the envoy deployment script, I get: bash: line 7: yarn: command not found. Does anybody know the reason?

0 likes
11 replies
lindstrom's avatar

Did you install yarn globally?

npm install -g yarn
caiquecastro's avatar

I have it globally. I can run it manually. The issue happens when I run through the envoy script.

caiquecastro's avatar

Should i have install it with sudo? But I don't think it's the best solution

ejdelmonico's avatar

Did you install Envoy globally as well? Can you post your envoy.blade.php file?

willvincent's avatar

Is envoy running as a different user than what was used to install yarn? That can make a difference. Not everything installed globally is globally available to all users.

willvincent's avatar

Now that said.. you can make npm install things globally for all users, but by default it doesn't necessarily do that.

The other way you could solve this would be to check if yarn is available in your envoyer script, and if not have the script install it. That would ensure it's available to envoyer.

Please or to participate in this conversation.