beyondcode / herd-community

91 stars 1 forks source link

[Bug]: Can't create new Laravel Project or install PestPHP on external disk, works fine on local system disk #1142

Closed Tray2 closed 1 day ago

Tray2 commented 1 week ago

Platform

macOS

Operating system version

macOs Sequoia 15.1

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.11.2

PHP Version

No response

Bug description

When trying to run laravel new some-project on a external disk, it fails saying that it can't find the composer.json file, and when trying to install PestPHP in and empty directory on the external drive using composer require pestphp/pest --dev --with-all-dependencies, first prompts me to allow plugins, and after entering y, it tries to install and then fails with this message Plugin pestphp/pest-plugin could not be initialized, class not found: Pest\Plugin\Manager.

Steps to reproduce

The Laravel installer

  1. Add an external volume directory to Herd Paths something like /Volumes/Expansion/Web-projects
  2. Run laravel new some-project in that directory.

The composer issue

  1. Add an external volume directory to Herd Paths something like /Volumes/Expansion/Web-projects
  2. Create a new directory in the given path
  3. Run composer require pestphp/pest --dev --with-all-dependencies

Relevant log output

# The Laravel installer

laravel new installer-test5

   _                               _
  | |                             | |
  | |     __ _ _ __ __ ___   _____| |
  | |    / _` | '__/ _` \ \ / / _ \ |
  | |___| (_| | | | (_| |\ V /  __/ |
  |______\__,_|_|  \__,_| \_/ \___|_|

 ┌ Would you like to install a starter kit? ────────────────────┐
 │ No starter kit                                               │
 └──────────────────────────────────────────────────────────────┘

 ┌ Which testing framework do you prefer? ──────────────────────┐
 │ Pest                                                         │
 └──────────────────────────────────────────────────────────────┘

Creating a "laravel/laravel" project at "./installer-test5"
Installing laravel/laravel (v11.3.2)
  - Installing laravel/laravel (v11.3.2): Extracting archive
Created project in /Volumes/Expansion/Web-projects/installer-test5

In Factory.php line 311:

  Composer could not find a composer.json file in /Volumes/Expansion/Web-projects/installer-test5
  To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--add-repository] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--ask] [--] [<package> [<directory> [<version>]]]

-----------------------------------------------------------------------------------------------------------------------
# The composer issue.

composer require pestphp/pest --dev --with-all-dependencies
./composer.json has been created
Running composer update pestphp/pest --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Lock file operations: 56 installs, 0 updates, 0 removals
  - Locking brianium/paratest (v7.6.0)
  - Locking doctrine/deprecations (1.1.3)
  - Locking fidry/cpu-core-counter (1.2.0)
  - Locking filp/whoops (2.16.0)
  - Locking jean85/pretty-package-versions (2.0.6)
  - Locking myclabs/deep-copy (1.12.1)
  - Locking nikic/php-parser (v5.3.1)
  - Locking nunomaduro/collision (v8.5.0)
  - Locking nunomaduro/termwind (v2.2.0)
  - Locking pestphp/pest (v3.5.1)
  - Locking pestphp/pest-plugin (v3.0.0)
  - Locking pestphp/pest-plugin-arch (v3.0.0)
  - Locking pestphp/pest-plugin-mutate (v3.0.5)
  - Locking phar-io/manifest (2.0.4)
  - Locking phar-io/version (3.2.1)
  - Locking phpdocumentor/reflection-common (2.2.0)
  - Locking phpdocumentor/reflection-docblock (5.6.0)
  - Locking phpdocumentor/type-resolver (1.10.0)
  - Locking phpstan/phpdoc-parser (2.0.0)
  - Locking phpunit/php-code-coverage (11.0.7)
  - Locking phpunit/php-file-iterator (5.1.0)
  - Locking phpunit/php-invoker (5.0.1)
  - Locking phpunit/php-text-template (4.0.1)
  - Locking phpunit/php-timer (7.0.1)
  - Locking phpunit/phpunit (11.4.3)
  - Locking psr/container (2.0.2)
  - Locking psr/log (3.0.2)
  - Locking psr/simple-cache (3.0.0)
  - Locking sebastian/cli-parser (3.0.2)
  - Locking sebastian/code-unit (3.0.1)
  - Locking sebastian/code-unit-reverse-lookup (4.0.1)
  - Locking sebastian/comparator (6.2.1)
  - Locking sebastian/complexity (4.0.1)
  - Locking sebastian/diff (6.0.2)
  - Locking sebastian/environment (7.2.0)
  - Locking sebastian/exporter (6.1.3)
  - Locking sebastian/global-state (7.0.2)
  - Locking sebastian/lines-of-code (3.0.1)
  - Locking sebastian/object-enumerator (6.0.1)
  - Locking sebastian/object-reflector (4.0.1)
  - Locking sebastian/recursion-context (6.0.2)
  - Locking sebastian/type (5.1.0)
  - Locking sebastian/version (5.0.2)
  - Locking symfony/console (v7.1.8)
  - Locking symfony/deprecation-contracts (v3.5.0)
  - Locking symfony/finder (v7.1.6)
  - Locking symfony/polyfill-ctype (v1.31.0)
  - Locking symfony/polyfill-intl-grapheme (v1.31.0)
  - Locking symfony/polyfill-intl-normalizer (v1.31.0)
  - Locking symfony/polyfill-mbstring (v1.31.0)
  - Locking symfony/process (v7.1.8)
  - Locking symfony/service-contracts (v3.5.0)
  - Locking symfony/string (v7.1.8)
  - Locking ta-tikoma/phpunit-architecture-test (0.8.4)
  - Locking theseer/tokenizer (1.2.3)
  - Locking webmozart/assert (1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 56 installs, 0 updates, 0 removals
pestphp/pest-plugin contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "pestphp/pest-plugin" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] y
  - Installing pestphp/pest-plugin (v3.0.0): Extracting archive
Plugin initialization failed (Plugin pestphp/pest-plugin could not be initialized, class not found: Pest\Plugin\Manager), uninstalling plugin
  - Removing pestphp/pest-plugin (v3.0.0)
    Install of pestphp/pest-plugin failed

In PluginManager.php line 301:

  Plugin pestphp/pest-plugin could not be initialized, class not found: Pest\Plugin\Manager

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-m|--minimal-changes] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]
mpociot commented 1 day ago

Hm I was able to successfully create a new Laravel project on an external disk. I was using a newer version of Composer though, so maybe that fixed it?

Try running composer self-update.

A new Herd update with the latest Composer version will be released tomorrow as well.