Skip to content

Commit a95f3cd

Browse files
committed
chore: We should be using the npm version provided by Node.js
While older versions of npm had specific issues on Windows, the latest npm@10 and npm@11 seem to be working fine, as they are the ones we are using already in boxednode.
1 parent 3a2fa0f commit a95f3cd

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

.evergreen/InstallNode.ps1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,4 @@ Write-Output "$filename downloaded"
1515
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
1616

1717
Expand-Archive $node_zip -DestinationPath $PSScriptRoot
18-
Get-ChildItem -Path $PSScriptRoot
19-
20-
Set-Location -Path $node_dir
21-
Remove-Item .\npm
22-
Remove-Item .\npm.cmd
23-
if (Test-Path .\npm.ps1) { Remove-Item .\npm.ps1 }
24-
Remove-Item .\npx
25-
Remove-Item .\npx.cmd
26-
if (Test-Path .\npx.ps1) { Remove-Item .\npx.ps1 }
27-
Move-Item .\node_modules\npm -Destination .\node_modules\npm2
28-
.\node.exe .\node_modules\npm2\bin\npm-cli.js i -g npm@6
18+
Get-ChildItem -Path $PSScriptRoot

.evergreen/install-node.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ set -e
33
set -x
44
export BASEDIR="$PWD/.evergreen"
55

6-
NPM_VERSION=10.8.3 # 10.9.0 does not install well on Windows
7-
86
if [ "$OS" == "Windows_NT" ]; then
97
powershell "$(cygpath -w "$BASEDIR")"/InstallNode.ps1
108
. "$BASEDIR/setup-env.sh"
11-
mkdir -p "$BASEDIR/npm-10" && (cd "$BASEDIR/npm-10" && echo '{}' > package.json && npm i npm@$NPM_VERSION)
12-
# using npm 10 because npm 9.9.3 does not install well on windows
13-
14-
curl -sSfLO https://raw.githubusercontent.com/mongodb-js/compass/42e6142ae08be6fec944b80ff6289e6bcd11badf/.evergreen/node-gyp-bug-workaround.sh && bash node-gyp-bug-workaround.sh
159
else
1610
if [ `uname` = Darwin ]; then
1711
export NVM_DIR="$BASEDIR/.nvm"
1812
mkdir -p "${NVM_DIR}"
19-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
13+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
2014

2115
echo "Setting NVM environment home: $NVM_DIR"
2216
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

.evergreen/setup-env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -x
44
OS_ARCH="$(uname "-m")"
55

66
export BASEDIR="$PWD/.evergreen"
7-
export PATH="$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:$PATH"
7+
export PATH="$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:$PATH"
88

99
export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf"
1010

0 commit comments

Comments
 (0)