1

I am new to laravel, composer, and windows terminal. I am trying to setup laravel on my local host. I currently have wamp installed and I have used it before to create basic websites. However, I am now doing a bigger project that needs a framework so I decided to learn Laravel. I installed composer as indicated in the directions, but when i run the command

"C:\wamp\www>composer create-project laravel/laravel laravel"

i generate an error message that says

"[InvalidArgumentException] Project directory laravel/ is not empty."

When I open a browser and navigate to "localhost/laravel/public" I encounter the error message from the title of this thread:

"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such

I have also added the appropriate environment variables from the composer instructions.

I am really lost at this point, and I have spent the past 4 hours trying to debug this.

I am running Windows 8 x64.

Edit:

I tried running composer install in C:\wamp\www and received an error message

Composer could not find the config file: C:\ProgramData]ComposerSetup\bin Ti initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section "

5 Answers 5

3

The dependencies for your project are not installed. Just download composer from GetComposer.org and install it on your Windows Machine. Then navigate to your project root, you will see a composer.json file there. That file specifies all the dependencies of the project. Run composer update in that directory. Composer will then update or install all required dependencies and your application won't show the error then.

cd \wamp\www\yourproject
composer update
Sign up to request clarification or add additional context in comments.

5 Comments

I tried that and when I run "composer update," I get the same error of "please create a composer.json file..."
Do you see a composer.json file in the root directory?
yes. when I open it, it looks like this: "{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "laravel/framework": "4.2.*" }, "autoload": { "classmap": [
"app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-create-project-cmd": [ "php artisan key:generate" ] }, "config": { "preferred-install": "dist" }, "minimum-stability": "stable" }
If you have the composer.json file, it doesn't make sense that composer cannot find it. Are you sure that you are issuing the command in the root of the project and not in the public folder? If the problem still persists, I would recommend installing a fresh copy of laravel by issuing this: composer create-project laravel/laravel --prefer-dist
1

"C:\wamp\www>composer create-project laravel/laravel laravel"

"[InvalidArgumentException] Project directory laravel/ is not empty."

This means C:\wamp\www\laravel already existed when you attempted to run the command. Remove the folder, or change the create-project command to use a different folder name for your new project.

"Warning:require(C:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed to open stream: No such

You need to do a composer install from C:\wamp\www\laravel.

1 Comment

ok, I just now ran "composer install" from C:\wamp\www\laravel and it returned an error message: "Composer could not find the config file: C:\ProgramData\ComposerSetup\bin to Intiialize a project, please create a composer.json file as described in the getcomposer.org "Getting Started" section
1

I figured it out! I was missing a folder called "vendor" and a file inside bootstrap called "compiled.php" Sorry for the inconvenience, and thank you for trying!

1 Comment

I am facing same issue, I am missing vendor directory and compiled.php file - can you describe, how did you resolved it? Thanks
1

use the following command to get vendor folder in your project

composer install --no-scripts

Comments

0

i had the same problem but i just ran this command

composer install

to install all the dependencies

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.