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
1d3fc338
Unverified
Commit
1d3fc338
authored
Nov 15, 2017
by
Jeremy Morrell
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont replace npm because of lockfile if npm is already >= 5 (#499)
parent
b9adc5f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
1 deletion
+39
-1
binaries.sh
lib/binaries.sh
+4
-1
package.json
test/fixtures/npm-lockfile-no-version/package.json
+3
-0
package-lock.json
...fixtures/npm-lockfile-node-6-no-version/package-lock.json
+12
-0
package.json
test/fixtures/npm-lockfile-node-6-no-version/package.json
+12
-0
run
test/run
+8
-0
No files found.
lib/binaries.sh
View file @
1d3fc338
...
@@ -69,8 +69,11 @@ install_npm() {
...
@@ -69,8 +69,11 @@ install_npm() {
local
version
=
"
$1
"
local
version
=
"
$1
"
local dir
=
"
$2
"
local dir
=
"
$2
"
local
npm_lock
=
"
$3
"
local
npm_lock
=
"
$3
"
local
npm_version
=
"
$(
npm
--version
)
"
if
$npm_lock
&&
[
"
$version
"
==
""
]
;
then
# If the user has not specified a version of npm, but has an npm lockfile
# upgrade them to npm 5.x if a suitable version was not installed with Node
if
$npm_lock
&&
[
"
$version
"
==
""
]
&&
[
"
${
npm_version
:0:1
}
"
-lt
"5"
]
;
then
echo
"Detected package-lock.json: defaulting npm to version 5.x.x"
echo
"Detected package-lock.json: defaulting npm to version 5.x.x"
version
=
"5.x.x"
version
=
"5.x.x"
fi
fi
...
...
test/fixtures/npm-lockfile-no-version/package.json
View file @
1d3fc338
...
@@ -5,5 +5,8 @@
...
@@ -5,5 +5,8 @@
"license"
:
"MIT"
,
"license"
:
"MIT"
,
"dependencies"
:
{
"dependencies"
:
{
"lodash"
:
"^4.16.4"
"lodash"
:
"^4.16.4"
},
"engines"
:
{
"node"
:
"8.9.1"
}
}
}
}
test/fixtures/npm-lockfile-node-6-no-version/package-lock.json
0 → 100644
View file @
1d3fc338
{
"name"
:
"yarn"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"dependencies"
:
{
"lodash"
:
{
"version"
:
"4.17.4"
,
"resolved"
:
"https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz"
,
"integrity"
:
"sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
}
}
}
test/fixtures/npm-lockfile-node-6-no-version/package.json
0 → 100644
View file @
1d3fc338
{
"name"
:
"yarn"
,
"version"
:
"1.0.0"
,
"main"
:
"index.js"
,
"license"
:
"MIT"
,
"dependencies"
:
{
"lodash"
:
"^4.16.4"
},
"engines"
:
{
"node"
:
"6.9.5"
}
}
test/run
View file @
1d3fc338
...
@@ -189,8 +189,16 @@ testYarnLockfileOutOfDate() {
...
@@ -189,8 +189,16 @@ testYarnLockfileOutOfDate() {
testDefaultToNpm5
()
{
testDefaultToNpm5
()
{
compile
"npm-lockfile-no-version"
compile
"npm-lockfile-no-version"
assertCaptured
"Using default npm version"
assertCaptured
"Installing node modules (package.json + package-lock)"
assertCapturedSuccess
}
testDefaultToNpm5WithNode6
()
{
compile
"npm-lockfile-node-6-no-version"
assertCaptured
"Detected package-lock.json"
assertCaptured
"Detected package-lock.json"
assertCaptured
"Bootstrapping npm 5"
assertCaptured
"Bootstrapping npm 5"
assertCaptured
"Installing node modules (package.json + package-lock)"
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