Gutenberg: wp-env causes segmentation fault on Ubuntu 20.04

Created on 29 May 2020  Â·  5Comments  Â·  Source: WordPress/gutenberg

Describe the bug

When you run npx wp-env start, you got the message,

npx wp-env start
✖ Error while running docker-compose command.
Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable

When you run sudo npx wp-env start, you got the message,

sudo npx wp-env start
The module '/home/sainthkh/v/gutenberg/node_modules/nodegit/build/Release/nodegit.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
Segmentation fault

To reproduce
Steps to reproduce the behavior:

  1. Clone repo and install dependencies with npm i.
  2. npx wp-env start or sudo npx wp-env start.

It might not be reproducible because it's related with nodejs version and compiling system.

Expected behavior

wp-env executes correctly.

Screenshots

N/A

Editor version (please complete the following information):

  • WordPress version: N/A
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? N/A
  • If the Gutenberg plugin is installed, which version is it? 8.2.1

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser N/A

Smartphone (please complete the following information):

N/A

[Package] Env [Type] Bug

All 5 comments

🤔

Please try re-compiling or re-installing the module

Out of curiosity, did you try updating npm and doing the re-compile step?

Couldn't connect to Docker daemon

A quick google seemed to indicate this is a really common problem when running Docker in Linux environments. Do you think there is anything we can do to mitigate it on our side of things? It sounds like fixing it would have to do with the local docker engine install. We could add docs to talk about how to fix it if you find a solution (https://askubuntu.com/questions/477551/how-can-i-use-docker-without-sudo)

@sainthkh I'm running things just fine, on Ubuntu 20.04 with NVM, when I add wp-env to my project's package.json, scripts section. I haven't attempted the use of NPX. What version of Node & NPM are you using with your setup? I've tested this is working with both v10 & v12 of Node.

I'll also add that I have also been able to run wp-env fine on PopOS, which is based on Ubuntu.

Following the setting from #25060, it works. Close this issue.

I'd like to note that I recently setup a new laptop running KDE Neon (which is based on Ubuntu), and following the steps detailed in the latest version of the docs worked for me: wp-env seems to be working perfectly there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasmussen picture jasmussen  Â·  3Comments

franz-josef-kaiser picture franz-josef-kaiser  Â·  3Comments

pfefferle picture pfefferle  Â·  3Comments

spocke picture spocke  Â·  3Comments

aduth picture aduth  Â·  3Comments