devloco / create-react-wptheme

Create modern, React-enabled WordPress themes with a single command.
MIT License
359 stars 60 forks source link

yarn start Fails with Open SSL message #72

Open ErikRobles opened 1 year ago

ErikRobles commented 1 year ago

When running yarn start or npm start, I get the following message. For those who downgraded to nodejs 16, they have stated that it works fine. However, how to get around this without downgrading? Thank you.

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
vciernava commented 9 months ago

Same issue, haven't figured out how to go around without downgrading

vciernava commented 9 months ago

Update: just figured out how to fix it.

On Windows command prompt: set NODE_OPTIONS=--openssl-legacy-provider

On PowerShell: $env:NODE_OPTIONS = "--openssl-legacy-provider"

walterwakefield commented 2 months ago

Hi!

I finally finally got this working.

Step 1) Run commans:

On Unix-like (Linux, macOS, Git bash, etc.): export NODE_OPTIONS=--openssl-legacy-provider

On Windows command prompt: set NODE_OPTIONS=--openssl-legacy-provider

On PowerShell: $env:NODE_OPTIONS = "--openssl-legacy-provider"

Step 2) Delete package.lock.json

Step 3) In package.json change "scripts" section to:

"scripts": { "crabuild": "react-scripts --openssl-legacy-provider build", "craeject": "react-scripts --openssl-legacy-provider eject", "crastart": "react-scripts --openssl-legacy-provider start", "cratest": "react-scripts --openssl-legacy-provider test", "build": "wptheme-scripts --openssl-legacy-provider build", "start": "wptheme-scripts --openssl-legacy-providerstart", "wpbuild": "wptheme-scripts --openssl-legacy-provider wpbuild", "wpstart": "wptheme-scripts --openssl-legacy-provider wpstart" }, Step 4) If the second time, we get a 8090 port in use error, find out which port by using command: sudo lsof -i :8090

then kill the process by using PID.

sudo kill -9

Then restart by using command sudo npm run wpstart