Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer can not find composer.json file #8325

Open
Jeff-Yan opened this issue Sep 11, 2019 · 5 comments
Labels

Comments

@Jeff-Yan
Copy link

@Jeff-Yan Jeff-Yan commented Sep 11, 2019

My composer.json:

C:\Users\jeffr\desktop\dce\dceu

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.1.3",
        "doctrine/dbal": "^2.9",
        "fideloper/proxy": "^4.0",
        "google/recaptcha": "~1.1",
        "intervention/image": "^2.5",
        "laravel/framework": "5.8.*",
        "laravel/tinker": "^1.0",
        "uxweb/sweet-alert": "^2.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^3.0",
        "phpunit/phpunit": "^7.5"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

Output of composer diagnose:

$ composer diagnose
Checking platform settings: OK
Checking git settings:

  [ErrorException]
  proc_open(NUL): failed to open stream: No such file or directory


diagnose

When I run this command:

composer install
or composer update

I get the following output:

$ composer install
Composer could not find a composer.json file in C:\Users\jeffr\desktop\dce\dceu
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

$ composer update
Composer could not find a composer.json file in C:\Users\jeffr\desktop\dce\dceu
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

And I expected this to happen:
it should install or update my packages

@Seldaek Seldaek added the Support label Sep 16, 2019
@otrigg

This comment has been minimized.

Copy link

@otrigg otrigg commented Sep 16, 2019

I experienced the same issue just a few hours ago, after a Windows 10 update.
Could not be able to use composer anymore.
I reverted to the previous working version and the issue disappeared.

@marcoskipper

This comment has been minimized.

Copy link

@marcoskipper marcoskipper commented Sep 16, 2019

I experienced the same issue just a few hours ago, after a Windows 10 update.
Could not be able to use composer anymore.
I reverted to the previous working version and the issue disappeared.

How you reverted to the previus working version? i have the same issue, is beacuse this windows 10 update?

@otrigg

This comment has been minimized.

Copy link

@otrigg otrigg commented Sep 16, 2019

I experienced the same issue just a few hours ago, after a Windows 10 update.
Could not be able to use composer anymore.
I reverted to the previous working version and the issue disappeared.

How you reverted to the previus working version? i have the same issue, is beacuse this windows 10 update?

I'm pretty sure it was Windows' today update in my case.
To revert, just: Windows Settings -> Update & Security -> Recovery -> Go back to previous version of Windows 10

@marcoskipper

This comment has been minimized.

Copy link

@marcoskipper marcoskipper commented Sep 16, 2019

I experienced the same issue just a few hours ago, after a Windows 10 update.
Could not be able to use composer anymore.
I reverted to the previous working version and the issue disappeared.

How you reverted to the previus working version? i have the same issue, is beacuse this windows 10 update?

I'm pretty sure it was Windows' today update in my case.
To revert, just: Windows Settings -> Update & Security -> Recovery -> Go back to previous version of Windows 10

Nice! i was fighting whit this error like 3 hours, thx a lot!

@Gitog

This comment has been minimized.

Copy link

@Gitog Gitog commented Nov 7, 2019

Ho do you resolve the same error hen using linux, i even changed path to compose location and still getting
'Composer could not find a composer.json file in /usr/local/bin
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.