• Resolved martinabaz

    (@martinabaz)


    I am trying to run my webpage from local host but I am getting this issue:

    × Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:283:19)
        at onErrorNT (node:internal/child_process:476:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
    GitError: Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:283:19)
        at onErrorNT (node:internal/child_process:476:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
        at Object.action (C:\Users\marti\AppData\Roaming\npm\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1261:25)
        at PluginStore.exec (C:\Users\marti\AppData\Roaming\npm\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1296:29)
        at C:\Users\marti\AppData\Roaming\npm\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1661:43
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (C:\Users\marti\AppData\Roaming\npm\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1659:16)
        at GitExecutorChain.<anonymous> (C:\Users\marti\AppData\Roaming\npm\node_modules\@wordpress\env\node_modules\simple-git\dist\cjs\index.js:1643:44)
        at Generator.next (<anonymous>)
        at fulfilled (C:\Users\marti\AppData\Roaming\npm\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',
          'C:\\Users\\marti\\.wp-env\\fc6be23cf5e91ade3c451d7ecd48b8e8\\WordPress'
        ],
        format: 'utf-8',
        parser: [Function: parser]
      }
    }

    What should I do?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter martinabaz

    (@martinabaz)

    after full 4hours trying to solve and asking the question at the end – I found out that I needed to change the terminal setting within Docker

    I searched for this issue and landed on this page.

    I want to run wp-env in my gitlab pipeline.

    I encountered the exact same error then.

    It would be great if you could share your solution.

    Yeah same here. Tried to change docker settings, but doesnt help.

    Thread Starter martinabaz

    (@martinabaz)

    Hello,
    I believe that there are different types of error on wp-env which are possible (I remember seeing more of them while searching on internet, I just knew that none of the was applicable for me)
    So in my case what I needed to do was ensure was to make sure that terminal setting in Docker matches to terminal that I was using.

    @martinabaz Thank you for sharing.

    I fixed this error yesterday.

    It was because git was not installed in Docker.

    It’s a rookie mistake and embarrassing, but I’ll share it.

    mallex

    (@alexanderhamren)

    @byg01046 How did you install git in docker? Did you set up anything outside of the docker images set up by wp-env? Excuse my ignorance, new to using docker.

    @alexanderhamren I’m not too used to either.

    As I wrote before, I’m setting up to work with the gitlab pipeline.

    image: docker:20.10.15
    
    services:
      - docker:20.10.15-dind
    
    variables:
      DOCKER_DRIVER: overlay2
      DOCKER_TLS_CERTDIR: ""
    
    stages:
      - test
    
    wordpress:
      stage: test
      tags:
        - tag-runner
      before_script:
        - apk update
        - apk add git
        - apk add curl
        - mkdir -p /usr/local/lib/docker/cli-plugins
        - curl -SL https://github.com/docker/compose/releases/download/v2.5.0/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
        - chmod a+x /usr/local/lib/docker/cli-plugins/docker-compose
        - apk add --update nodejs npm
        - apk add nodejs-current npm
        - npm i @wordpress/env --save-dev
      script:
        - npm run wp-env destroy && npm run wp-env start
      only:
        - web
      artifacts:
        when: always
        name: "results"
        paths:
          - ./

    Here are the settings I wrote.

    I’m still having issues, wp-env can’t connect to the database and start.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘wp-env start issue’ is closed to new replies.