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() {
if
[
"
$version
"
==
""
]
;
then
echo
"Using default npm version:
`
npm
--version
`
"
elif
[[
`
npm
--version
`
==
"
$version
"
]]
;
then
echo
"npm
`
npm
--version
`
already installed with node"
else
if
needs_resolution
"
$version
"
;
then
echo
"Resolving npm version
${
version
}
via semver.io..."
version
=
$(
curl
--silent
--get
--retry
5
--retry-max-time
15
--data-urlencode
"range=
${
version
}
"
https://semver.herokuapp.com/npm/resolve
)
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
echo
"Bootstrapping npm
$version
(replacing
`
npm
--version
`
)..."
if
!
npm
install
--unsafe-perm
--quiet
-g
"npm@
$version
"
2>@1>/dev/null
;
then
echo
"Unable to install npm
$version
; does it exist?"
&&
false
fi
echo
"npm
`
npm
--version
`
installed"
fi
}
test/run
View file @
c1b8023c
...
...
@@ -132,7 +132,7 @@ testErrorYarnAndNpmShrinkwrap() {
testDefaultToNpm5
()
{
compile
"npm-lockfile-no-version"
assertCaptured
"Detected package-lock.json"
assertCaptured
"
Downloading and installing npm 5.
"
assertCaptured
"
Bootstrapping npm 5
"
assertCapturedSuccess
}
...
...
@@ -431,7 +431,7 @@ testOldNpm2() {
testNonexistentNpm
()
{
compile
"nonexistent-npm"
assertCaptured
"
version not found: npm@
1.1.65"
assertCaptured
"
Unable to install npm
1.1.65"
assertCapturedError 1
""
}
...
...
@@ -443,15 +443,13 @@ testSameNpm() {
testNpmVersionRange
()
{
compile
"npm-version-range"
assertCaptured
"Resolving npm version"
assertCaptured
"installing npm 1.4."
assertCaptured
"Bootstrapping npm 1.4.x"
assertCapturedSuccess
}
testNpmVersionSpecific
()
{
compile
"npm-version-specific"
assertCaptured
"installing npm 2.1.11"
assertNotCaptured
"Resolving npm version"
assertCaptured
"Bootstrapping npm 2.1.11"
assertNotCaptured
"WARNING"
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