fix: error:0308010C:digital envelope routines::unsupported (#1447)

* fix: error:0308010C:digital envelope routines::unsupported

* fix: process.env.UNSET_NODE_OPTIONS
This commit is contained in:
chenos 2023-02-10 11:16:36 +08:00 committed by GitHub
parent f8a11cbbf0
commit 2dc9c5c444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 3 deletions

View File

@ -19,7 +19,7 @@ jobs:
sqlite-test: sqlite-test:
strategy: strategy:
matrix: matrix:
node_version: ['16'] node_version: ['16', '18']
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
steps: steps:
@ -30,6 +30,7 @@ jobs:
node-version: ${{ matrix.node_version }} node-version: ${{ matrix.node_version }}
cache: 'yarn' cache: 'yarn'
- run: yarn install - run: yarn install
- run: yarn build
- name: Test with Sqlite - name: Test with Sqlite
run: yarn test run: yarn test
env: env:
@ -39,7 +40,7 @@ jobs:
postgres-test: postgres-test:
strategy: strategy:
matrix: matrix:
node_version: ['16'] node_version: ['16', '18']
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
@ -66,6 +67,7 @@ jobs:
node-version: ${{ matrix.node_version }} node-version: ${{ matrix.node_version }}
cache: 'yarn' cache: 'yarn'
- run: yarn install - run: yarn install
- run: yarn build
- name: Test with postgres - name: Test with postgres
run: yarn test run: yarn test
env: env:
@ -79,7 +81,7 @@ jobs:
mysql-test: mysql-test:
strategy: strategy:
matrix: matrix:
node_version: ['16'] node_version: ['16', '18']
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:${{ matrix.node_version }} container: node:${{ matrix.node_version }}
services: services:
@ -97,6 +99,7 @@ jobs:
node-version: ${{ matrix.node_version }} node-version: ${{ matrix.node_version }}
cache: 'yarn' cache: 'yarn'
- run: yarn install - run: yarn install
- run: yarn build
- name: Test with MySQL - name: Test with MySQL
run: yarn test run: yarn test
env: env:

View File

@ -35,6 +35,21 @@ for (const key in env) {
} }
} }
if (require('semver').satisfies(process.version, '>16') && !process.env.UNSET_NODE_OPTIONS) {
if (process.env.NODE_OPTIONS) {
let opts = process.env.NODE_OPTIONS;
if (!opts.includes('--openssl-legacy-provider')) {
opts = opts + ' --openssl-legacy-provider';
}
if (!opts.includes('--no-experimental-fetch')) {
opts = opts + ' --no-experimental-fetch';
}
process.env.NODE_OPTIONS = opts;
} else {
process.env.NODE_OPTIONS = '--openssl-legacy-provider --no-experimental-fetch';
}
}
const cli = require('../src/cli'); const cli = require('../src/cli');
cli.parse(process.argv); cli.parse(process.argv);