Skip to content

Commit

Permalink
Merge pull request #6742 from wordpress-mobile/try/limit-sockets-npm
Browse files Browse the repository at this point in the history
Try --maxsockets flag to limit ECONNRESET failures
  • Loading branch information
Gerardo Pacheco authored Mar 20, 2024
2 parents ba30c8b + e2bf4cf commit fbdcf1a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion .buildkite/commands/install-node-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,18 @@ if [[ "${RESTORE_ONLY}" == 'true' ]]; then
fi

echo "--- :npm: Install Node dependencies"
npm ci --unsafe-perm --prefer-offline --no-audit --no-progress "$@"

MAX_SOCKETS=15 # Default value from npm

# To avoid constant ECONNRESET errors a limit is set for Linux,
# as this is not happening with the Mac jobs.
# This issue is being tracked here:
# https://github.com/npm/cli/issues/4652
if [ "$PLATFORM" = "Linux" ]; then
MAX_SOCKETS=1
fi

npm ci --unsafe-perm --prefer-offline --no-audit --no-progress --maxsockets "$MAX_SOCKETS" "$@"

echo "--- :npm: Save cache if necessary"
# Notice that we don't cache the local node_modules.
Expand Down

0 comments on commit fbdcf1a

Please sign in to comment.