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

elo's avatar
Level 3

Laravel vendor does not exist and could not be created on Mac

I am making a switch from windows to mac, so I installed composer globally and pulled laravel project from github. When I run composer install inside the the laravel project I keep getting a run time exception error

[RuntimeException] /Users/developer/mike/code/laravel/vendor does not exist and could not be created.

Please how do I resolve this so that I can install the project dependencies?

0 likes
3 replies
ahmadmayahi's avatar

As the error states, it's a permission issue.

Make sure your project has the correct permissions to create the vendor folder.

You might need to use sudo chown -R mike /Users/developer/mike/code/ && chmod -R 777 /Users/developer/mike/code/vendor

1 like
elo's avatar
elo
OP
Best Answer
Level 3

@ahmadmayahi you were right it was a permission issue. However because it was a work laptop and I didn't have access to the root user, I simply solved the issue by running sudo composer install.

Sorry my response is coming late, but I hope this is helpful to others.

3 likes
JonathanAspeling's avatar

I had a similar issue on my Windows machine running WSL, Docker with Sail.

I did a ls -la on my app directory on wsl and saw that the vendor folder belonged to root and not to my user.

So ran a chown myName:myName -R ./vendor

And that solved it for me

Please or to participate in this conversation.