Skip to content

Commit e1c30c5

Browse files
author
Ben Newman
committed
Use npm@1.4.12 to install npm@2.14.22 to install npm@3.1.2 on Windows.
1 parent 8f9f0de commit e1c30c5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/generate-dev-bundle.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ $webclient.DownloadFile($node_link, "$DIR\bin\node.exe")
3939

4040
# download initial version of npm
4141
$npm_zip = "$DIR\bin\npm.zip"
42-
$npm_link = "https://nodejs.org/dist/npm/npm-${NPM_VERSION}.zip"
42+
43+
# These dist/npm archives were only published for 1.x versions of npm, and
44+
# this is the most recent one.
45+
$npm_link = "https://nodejs.org/dist/npm/npm-1.4.12.zip"
4346
$webclient.DownloadFile($npm_link, $npm_zip)
4447

4548
$zip = $shell.NameSpace($npm_zip)
@@ -52,6 +55,14 @@ rm -Recurse -Force $npm_zip
5255
# add bin to the front of the path so we can use our own node for building
5356
$env:PATH = "${DIR}\bin;${env:PATH}"
5457

58+
# Install the version of npm that we're actually going to expose from the
59+
# dev bundle. Note that we use npm@1.4.12 to install npm@${NPM_VERSION},
60+
# but we use npm@3.1.2 to install dev_bundle\lib\node_modules, so that the
61+
# dev bundle packages have a flatter structure. Three different versions!
62+
cd "${DIR}\lib"
63+
npm install npm@${NPM_VERSION}
64+
npm version
65+
5566
mkdir "${DIR}\bin\npm3"
5667
cd "${DIR}\bin\npm3"
5768
echo "{}" | Out-File package.json -Encoding ascii # otherwise it doesn't install in local dir

0 commit comments

Comments
 (0)