0

I am starting a new PHP project, and I wanted to pull some php components such as "nesbot/carbon" using composer. But when I create a composer.json file and try to run composer install command, it downloads other files from my previous projects that I don's want.

Even when I try to run "composer install" with out having a composer.json file in an empty folder, it downloads some previous dependencies from caches. I didn't get that from where it's reading composer.json. Am stuck in the middle of project.

How can I create a fresh project with composer?

3
  • You could perhaps start by showing us your composer.json file Commented Dec 21, 2015 at 8:13
  • { "require": { "nesbot/carbon": "1.21.0" } } Commented Dec 21, 2015 at 9:16
  • Might sound silly, but are you sure you're running composer install from the folder you got anything inside? Maybe on the terminal you're located in a different folder with a package.json file. Could you show us what is it returned if you run ls -l from your terminal? Commented Dec 22, 2015 at 14:46

1 Answer 1

0

To create a fresh project with composer, run

$ composer init

in the root directory of that project.

For reference, see https://getcomposer.org/doc/03-cli.md#init.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.