gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

@wordpress/env: unable to launch wp-env start

Open DaveWP opened this issue 2 years ago • 1 comments

Description

I am unable to use the wp_env start command on Windows 11 getting error "Error: spawn git ENOENT"

D:\******>wp-env start
× Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19)
    at onErrorNT (internal/child_process.js:472:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
GitError: Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:19)
    at onErrorNT (internal/child_process.js:472:16)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
    at Object.action (D:\***\AppData\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1274:25)
    at PluginStore.exec (D:\***\AppData\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1309:29)
    at D:\Users\***\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1674:43
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (D:\Users\***\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1672:16)
    at GitExecutorChain.<anonymous> (D:\Users\***\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1656:44)
    at Generator.next (<anonymous>)
    at fulfilled (D:\Users\***\Roaming\nvm\v14.20.1\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:55:24) {
  task: {
    commands: [
      'clone',
      '--depth=1',
      '--no-single-branch',
      'https://github.com/WordPress/WordPress.git',
      'D:\\Users\\***\\wp_env\\3cf2e462d9e94317b3b37989b53578b2\\WordPress'
    ],
    format: 'utf-8',
    parser: [Function: parser]
  }
}

Step-by-step reproduction instructions

Running Windows Home edition with latest updates applied

  1. Install Docker on Windows 11
  2. Install Windows Subsystem for Linux
  3. Start Docker
  4. Run 'npm -g i @wordpress/env'
  5. Enter 'wp_env start'
  6. The command starts downloading the wordpress images and then crashes.

Screenshots, screen recording, code snippet

I have been able to get Docker running image 1c8083a908639a4921369a6a54d72e8667d54999ab9f20eeda9a0e6d42ee1796 but it appears to be an uninitialised wordpress installation. It is not clear which Docker image I should be using as the documentation merely states:

_Finally, navigate to http://localhost:8888 in your web browser to see WordPress running with the local WordPress plugin or theme running and activated. Default login credentials are username: admin password: password._

Environment info

Windows 11 Home edition

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

DaveWP avatar Jan 30 '23 15:01 DaveWP

Hi, @DaveWP

Can you confirm that you've git installed and available in a shell? You can do this by running the following command git --version

Thank you!

Mamaduka avatar Jan 31 '23 14:01 Mamaduka

I have been able to solve the problem, by:

  1. Installing Windows Subsystem for Linux (via the Windows Store)
  2. Installing Git for Windows (website download)
  3. Removing Docker
  4. Installing Docker with Administration rights

Perhaps the documentation could be updated on the wordpress developers website to cover the requirements for git and WSL, as well as installing Docker with admin rights.

DaveWP avatar Feb 02 '23 13:02 DaveWP

Thanks for the update, @DaveWP!

Mamaduka avatar Feb 02 '23 14:02 Mamaduka