cancel
Showing results for 
Search instead for 
Did you mean: 

Composer Json can't Be Opened Error

Composer Json can't Be Opened Error

Hi all, I'm trying to install a custom Magento 2 theme. Every time I try to upgrade, I get this error 

 

File "/composer.json" cannot be opened Warning!fopen(/composer.json): failed to open stream: No such file or directory

I have no idea what's happening. I've checked permissions all is in order. I can install Magento 2.1.7 from scratch and it works, it is only a problem when I add the app and pub folders from the custom theme, or for that matter try to install their full package. I always run into the error mentioned above.

 

Can anyone help?

 

Thanks,

 

Dane 

1 REPLY 1

Re: Composer Json can't Be Opened Error

Could you please confirm ? that your theme have composer.json file in theme directory  ?

 

If not than create composer.json file in your custom theme. Mention the theme details there and then run it for the same it will works !!

 

Composer.json file structure for custom theme :

 

{
    "name": "magento/theme-frontend-yourthemename",
    "description": "N/A",
    "require": {
        "php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
        "magento/theme-frontend-blank": "100.2.*",
        "magento/framework": "101.0.*"
    },
    "type": "magento2-theme",
    "version": "100.2.2",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

 

 

 

 

if issue solved,Click Kudos & Accept as Solution