2

What i have tried:

1) Install php7.2
2) Install Composer
3) run command composer global require "laravel/installer"

But when i run laravel new blog the output error is the following:

The provided cwd does not exist.

5
  • I'd guess you missed the "Make sure to place composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system." bit in the docs. Commented Sep 19, 2018 at 15:47
  • 1
    (That said, I find the laravel new installer entirely pointless. It's just a shortcut for the composer create-project --prefer-dist laravel/laravel command. I just skip it entirely.) Commented Sep 19, 2018 at 15:48
  • You need to use this Command properly in your htdocs folder composer create-project "laravel/laravel" project_name Commented Sep 19, 2018 at 15:56
  • In WSL restarting the terminal fixed my issue Commented Jan 16, 2023 at 19:31
  • try this url. this is solve my problem Commented Oct 28, 2023 at 13:50

2 Answers 2

1

The provided cwd does not exist means that the Current Working Directory does not exist which means that laravel new command was unable to create the directory 'blog' because you do not have the permission to do so.

What you can do is to change the permissions for that directory, so the command is able to create the working directory

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

1 Comment

How do you change the permission in this case?
0

in App\Providers\AppServiceProvider in register function I commented these lines of code and it worked

before:

 public function register()
{
    $this->app->bind('path.public', function() {
        return realpath(base_path().'/../public_html');
    });
}

after:

 public function register()
{
    //$this->app->bind('path.public', function() {
    //return realpath(base_path().'/../public_html');
  });
}

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.