0
votes

I want to create a new project using Laravel.

From the documentation, I downloaded Composer using its Windows executable installer.

I have already set the path to: C:\Users\marti\AppData\Roaming\Composer\vendor\bin

**I created the vendor\bin directory

From the command prompt, the command "composer" works. I tried to install Laravel using the laravel installer and it gives me an error also with the create-project command. I have tried both methods even with administrative privillages but still there is an error.

Using Laravel Installer:

[ErrorException] file_put_contents(C:\Users\marti\AppData\Roaming\Composer\vendor\bin): failed to open stream: Permission denied

Using create-project method:

[InvalidArgumentException] Composer could not find the config file: C:\Users\marti\AppData\Roaming\Composer\vendor\bin To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S tarted" section

PLEASE HELP!

Error when using laravel installer

Error when using create-project method

3
Welcome to StackOverflow. Please use code snippet formatting.mrvol
I faced a very similar problem. I had my project set up in C:// drive. Later, I found that authenticated users were not given full access to folders in C: drive. I changed that in the properties and it worked.Aadesh Dhakal

3 Answers

1
votes

I deleted the Composer path variable, changed directory to read "C:>" and ran the command "composer global require laravel/installer"

0
votes

Try requiring Laravel installer from composer composer global require laravel/installer then simply make a new laravel project laravel new {PROJECT_NAME}

0
votes

Composer(for windows), as of build v1.10.13 does not require you to manually set then env path variable.

You dont have to change or add anything in the composer installation directory or to environment path variable.

If you have done so, then do the following

  • Re-install composer.
  • Run composer in a new cmd window, to see if its is installed properly.
  • Run composer create-project --prefer-dist laravel/laravel <your project name> and now your project should be set up properly.