Skip to content

Commit

Permalink
Fix node-options.sh
Browse files Browse the repository at this point in the history
This script is called from npm run {start|build}, but was it causing an
exception on my wsl machine. Likely because it could not cope with the
output of `node -v` being prefixed with a 'v', e.g. v18.17.1
  • Loading branch information
martinbosma committed Sep 18, 2023
1 parent d41676d commit 433147b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion node-options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# that still create hashes with legacy cryptographic algorithms like MD4.

# Get only major number of Node.js version
VERSION=`node -v | while IFS=. read a b; do echo "$a"; done | grep -o -E "\d*"`
VERSION=`node -v | sed -nr 's/^v([0-9]+)\..*/\1/p'`

# Apply --openssl-legacy-provider option only for node v17 and higher
if [ $VERSION -gt "16" ]
Expand Down

0 comments on commit 433147b

Please sign in to comment.