markshust / docker-magento

Mark Shust's Docker Configuration for Magento
https://m.academy/courses/set-up-magento-2-development-environment-docker/
MIT License
2.57k stars 1.01k forks source link

PWA Install: error:0308010C:digital envelope routines::unsupported #868

Open cbartellds opened 1 year ago

cbartellds commented 1 year ago

I am trying to run the bin/pwa-studio command on a fresh install, but keep returning the same error.

Commands:

  1. curl -s https://raw.githubusercontent.com/markshust/docker-magento/master/lib/onelinesetup | bash -s -- magento.test 2.4.5-p1 community
  2. bin/npm install yarn
  3. npx browserslist@latest --update-db
  4. bin/setup-pwa-studio magento.test

This is where it errors and the error I get:

Preparing packages... Ensuring valid environment... Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating ✨ Done in 60.86s. yarn run v1.22.19 $ /Sites/pwa/pwa-studio/node_modules/.bin/buildpack create-custom-origin packages/venia-concept Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating ⓧ error:0308010C:digital envelope routines::unsupported ⓧ Error: error:0308010C:digital envelope routines::unsupported error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

When I run the "npx browserslist@latest --update-db" command I get this:

Latest version: 1.0.30001457 Installed version: none Removing old caniuse-lite from lock file Installing new caniuse-lite version $ npm install caniuse-lite Cleaning package.json dependencies from caniuse-lite $ npm uninstall caniuse-lite caniuse-lite has been successfully updated

No target browser changes

Just stumped ... I have yarn and node installed on my Mac.

~ % node -v v18.14.0 ~ % yarn -v 1.22.19

I don't know if yarn or node has something to do with the error or if there is something else going on. Any suggestions would be greatly appreciated. Thank you.

YevhenZvieriev commented 9 months ago

Hi, @cbartellds

This error is typically related to OpenSSL

It will help you:

sudo apt update
sudo apt install libssl-dev

After updating OpenSSL, try running the command again.

For many people, the following command will fix the issue:

npm audit fix --force

However, be aware that, for complex builds, the above command will pull in breaking security fixes that can potentially break your build.

Most suggest either downgrading Node.js to pre v17 or using the legacy SSL provider. Both of those solutions are hacks that leave your builds open to security threats.

nvm install 16
nvm use 16

Please note, if you use nvm use 16, you should execute bin/setup-pwa-studio in the same terminal

The nvm use 16 command sets the version of Node.js for the current session. However, the next time you open a new terminal or restart the system, you will lose this setting. You can work around this by setting your preferred version of Node.js as the default version you always use.

I executed nvm install 16, and yarn buildpack create-custom-origin packages/venia-concept finished without errors