Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNikhil Khandelwal
9,371 PointsNone of my composer commands like init, composer require etc are working in my local machine. I am using MAMP.
Nikhils-MacBook-Air:Pro Nikhil$ composer require slim/slim -bash: composer: command not found Nikhils-MacBook-Air:Pro Nikhil$ composer init -bash: composer: command not found
Nikhil Khandelwal
9,371 PointsHey thanks Carl.... I wasted 8 hours searching for the solution on net.... Your solution worked. :)
Carl Mungazi
9,071 PointsGlad to hear that! I had the same problem last night and it took me a while to figure it out.
1 Answer
Abiola Akinnubi
Courses Plus Student 1,705 PointsYou will need to install your composer through your plugin manager or package control then it will be added to your tools which you can then use the init and then add dependency. i used it will phpstorm this way and it works fine. kindly let's know what code editor or IDE you are using on your MAMP Nikhil Khandelwal
Carl Mungazi
9,071 PointsCarl Mungazi
9,071 PointsTry writing php composer.phar init etc. I think you have to configure something on your local machine to allow you to write 'composer' by itself.
Also, I assume you are working out of the directory in which you installed composer?