Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Fix npm caching issues #510

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions run-build-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,16 @@ run_npm() {
fi
fi

if install_deps package.json $NODE_VERSION $NETLIFY_CACHE_DIR/package-sha
echo "Installing NPM modules using NPM version $(npm --version)"
run_npm_set_temp
if npm install ${NPM_FLAGS:+"$NPM_FLAGS"}
then
echo "Installing NPM modules using NPM version $(npm --version)"
run_npm_set_temp
if npm install ${NPM_FLAGS:+"$NPM_FLAGS"}
then
echo "NPM modules installed"
else
echo "Error during NPM install"
exit 1
fi

echo "$(shasum package.json)-$NODE_VERSION" > $NETLIFY_CACHE_DIR/package-sha
echo "NPM modules installed"
else
echo "Error during NPM install"
exit 1
fi

export PATH=$(npm bin):$PATH
}

Expand Down