问题
When I try to create a new Laravel project I get this error:
c:\xampp\htdocs>composer create-project --prefer-dist laravel/laravel blog
Creating a "laravel/laravel" project at "./blog"
Installing laravel/laravel (v8.4.0)
- Installing laravel/laravel (v8.4.0): Extracting archive
Created project in C:\xampp\htdocs\blog
[ErrorException]
chdir(): No such file or directory (errno 2)
I'm using XAMPP by the way.
回答1:
Please try this:
composer self-update
回答2:
In window
When you install composer, please choose the option "for only me".(for administrative purpose). don't choose the option "all users". if you choose the option "all users", you will get the installation error that is "chdir():No
Such file or directory, errno 2" when you install laravel through composer (command from
laravel offical documentation,"composer create-project --prefer-dist laravel/laravel blog").
来源:https://stackoverflow.com/questions/64723171/errorexception-chdir-no-such-file-or-directory-errno-2-when-trying-to-creat