Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
c1b8023c
Commit
c1b8023c
authored
Jul 19, 2017
by
Jeremy Morrell
Committed by
Jeremy Morrell
Jul 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the use of semver.io to bootstrap npm
parent
fbe5a910
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
binaries.sh
lib/binaries.sh
+6
-9
run
test/run
+4
-6
No files found.
lib/binaries.sh
View file @
c1b8023c
...
@@ -85,16 +85,13 @@ install_npm() {
...
@@ -85,16 +85,13 @@ install_npm() {
if
[
"
$version
"
==
""
]
;
then
if
[
"
$version
"
==
""
]
;
then
echo
"Using default npm version:
`
npm
--version
`
"
echo
"Using default npm version:
`
npm
--version
`
"
elif
[[
`
npm
--version
`
==
"
$version
"
]]
;
then
echo
"npm
`
npm
--version
`
already installed with node"
else
else
if
needs_resolution
"
$version
"
;
then
echo
"Bootstrapping npm
$version
(replacing
`
npm
--version
`
)..."
echo
"Resolving npm version
${
version
}
via semver.io..."
if
!
npm
install
--unsafe-perm
--quiet
-g
"npm@
$version
"
2>@1>/dev/null
;
then
version
=
$(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
${
version
}
"
https://semver.herokuapp.com/npm/resolve
)
echo
"Unable to install npm
$version
; does it exist?"
&&
false
fi
if
[[
`
npm
--version
`
==
"
$version
"
]]
;
then
echo
"npm
`
npm
--version
`
already installed with node"
else
echo
"Downloading and installing npm
$version
(replacing version
`
npm
--version
`
)..."
npm
install
--unsafe-perm
--quiet
-g
npm@
$version
2>&1
>
/dev/null
fi
fi
echo
"npm
`
npm
--version
`
installed"
fi
fi
}
}
test/run
View file @
c1b8023c
...
@@ -132,7 +132,7 @@ testErrorYarnAndNpmShrinkwrap() {
...
@@ -132,7 +132,7 @@ testErrorYarnAndNpmShrinkwrap() {
testDefaultToNpm5
()
{
testDefaultToNpm5
()
{
compile
"npm-lockfile-no-version"
compile
"npm-lockfile-no-version"
assertCaptured
"Detected package-lock.json"
assertCaptured
"Detected package-lock.json"
assertCaptured
"
Downloading and installing npm 5.
"
assertCaptured
"
Bootstrapping npm 5
"
assertCapturedSuccess
assertCapturedSuccess
}
}
...
@@ -431,7 +431,7 @@ testOldNpm2() {
...
@@ -431,7 +431,7 @@ testOldNpm2() {
testNonexistentNpm
()
{
testNonexistentNpm
()
{
compile
"nonexistent-npm"
compile
"nonexistent-npm"
assertCaptured
"
version not found: npm@
1.1.65"
assertCaptured
"
Unable to install npm
1.1.65"
assertCapturedError 1
""
assertCapturedError 1
""
}
}
...
@@ -443,15 +443,13 @@ testSameNpm() {
...
@@ -443,15 +443,13 @@ testSameNpm() {
testNpmVersionRange
()
{
testNpmVersionRange
()
{
compile
"npm-version-range"
compile
"npm-version-range"
assertCaptured
"Resolving npm version"
assertCaptured
"Bootstrapping npm 1.4.x"
assertCaptured
"installing npm 1.4."
assertCapturedSuccess
assertCapturedSuccess
}
}
testNpmVersionSpecific
()
{
testNpmVersionSpecific
()
{
compile
"npm-version-specific"
compile
"npm-version-specific"
assertCaptured
"installing npm 2.1.11"
assertCaptured
"Bootstrapping npm 2.1.11"
assertNotCaptured
"Resolving npm version"
assertNotCaptured
"WARNING"
assertNotCaptured
"WARNING"
assertCapturedSuccess
assertCapturedSuccess
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment