CLI => shopify app create php => Failed to install Composer packages

With “shopify app create php” i got this error:

“Unable to install all 15 dependencies┃ Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run composer update or composer update <package name>.”

I’m presuming you’ve already tried running the suggested command?

composer update

yes, it but the main problem that you cant continue with Shopify CLI create project as it already broken on step with composer.

The problem was just in a space in my working directory path.

Could you please explain the solution in detail ? Because, I’m also facing the same problem.

can you elaborate how we solve this?

Hi @ayush123

So where you’re runing the files from - make sure that there are no spaces in any of the folder names.

For example:

C:\User\Ayush\My Code\Shopify ← This won’t work because there is a space in “My Code”

C:\User\Ayush\My_Code\Shopify ← This will work because there are no spaces in the path

So check the folders you’re in and rename them if they contain a space to either remove the space, or replace it with an underscore (_) or hyphen (-).

Then run the command again and it should function as expected.

@SB_90

there’s no spaces in my directory

/home/shopify_dev

and its shows,

Error:

OptiPlex-390:/home/shopify_dev$ shopify app create php
? App name
[0;94m> [0m[33mtest
? What type of app are you building? (You chose: Public: An app built for a wide merchant audience.)
Partner organization Demo (2242736)
Using development store demo-devlopment.myshopify.com
✓ PHP 8.1.2
✓ npm 8.5.1
┏━━ Cloning https://github.com/Shopify/shopify-app-php.git into test… ━━━━━━━━━━
┃ 100%
┗━━ ✓ Cloned into test ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ (3.68s) ━━
✓ .env saved to project root
┏━━ Installing Composer dependencies… ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ ✗ Unable to install all 15 dependencies
┃ Your lock file does not contain a compatible set of packages. Please run composer update.
┗━━ An error occurred while installing dependencies ━━━━━━━━━━━━━━━━━━ (0.3s) ━━
┏━━ Error ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ ✗ Failed to install Composer packages
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Hi @ayush123

Can you show us the output of the command it suggests in the error:

composer update

Thanks