diff --git a/node-options.sh b/node-options.sh index 9c7edfbc5..0e6aea79e 100755 --- a/node-options.sh +++ b/node-options.sh @@ -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" ]