Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error not caught properly #7556

@teo1978

Description

@teo1978

I know I've done something wrong, but I expect a sensible error message telling me what's wrong, so hear me out.

On my debian server, as root, I installed composer globally as indicated here:
https://getcomposer.org/doc/00-intro.md#globally

composer was installed correctly and worked as expected, but then when I tried it out requiring some package (which got installed succesfully), I got this message:

Do not run Composer as root/super user! See https://getcomposer.org/root for details

So, since I am a good boy, I su-ed to the user www-data, and then I tried:

composer global require laravel/installer

(which is the same that had worked perfectly when run as root)

Expected:
a sensible error message from composer telling me whatever I am doing wrong

Observed
An error message from the OS telling composer what composer is doing wrong.
Namely, this was the error message:

                                                
  [ErrorException]                              
  chdir(): No such file or directory (errno 2)  
                                                

global <command-name> [<args>]...

I'm pretty sure there's something wrong in installing composer as root and then trying to use it as another user - that doesn't seem wrong per se, but I'm probably missing some necessary step. Anyway, the error message I'm getting makes no sense whatsoever from the perspective of the user and gives me no clue of what I am supposed to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions