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
f8632a74
Commit
f8632a74
authored
Jan 02, 2015
by
Hunter Loftis
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #161 from heroku/install-with-prebuilt
run npm install even with prebuild node_modules
parents
1ebb095a
0d8e7efe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
10 deletions
+8
-10
README.md
README.md
+4
-4
compile
bin/compile
+2
-2
test
bin/test
+2
-4
No files found.
README.md
View file @
f8632a74
...
...
@@ -7,15 +7,15 @@ This is the official [Heroku buildpack](http://devcenter.heroku.com/articles/bui
Apps are built via one of four paths:
1.
A regular
`npm install`
(default scenario)
1.
A regular
`npm install`
(
first build;
default scenario)
2.
Copy existing
`node_modules`
from cache, then
`npm prune`
, then
`npm install`
(subsequent builds)
3.
No build
(if package.json doesn't exist but server.js does)
4.
Run
`npm run preinstall`
,
`npm rebuild`
,
`npm run post
install`
(
`node_modules`
are checked into source control)
3.
Skip dependencies
(if package.json doesn't exist but server.js does)
4.
Skip cache, run
`npm rebuild`
before
`npm
install`
(
`node_modules`
are checked into source control)
You should only use #3 (omitting package.json) for quick tests or experiments.
You should never use #4 - it's included for backwards-compatibility and will generate warnings.
Checking in
`node_modules`
is an antipattern.
**Checking in `node_modules` is an antipattern.**
For more information, see
[
the npm docs
](
https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git-
)
For technical details, check out the
[
heavily-commented compile script
](
https://github.com/heroku/heroku-buildpack-nodejs/blob/master/bin/compile
)
.
...
...
bin/compile
View file @
f8632a74
...
...
@@ -129,9 +129,9 @@ if [ "$modules_source" == "" ]; then
elif
[
$modules_source
==
"prebuilt"
]
;
then
info
"Rebuilding any native modules for this architecture"
npm run preinstall 2>&1 | indent
npm rebuild 2>&1 | indent
npm run postinstall 2>&1 | indent
info
"Installing any new modules"
npm
install
--quiet
--userconfig
$build_dir
/.npmrc 2>&1 | indent
elif
$use_cache
;
then
info
"Restoring node modules from cache"
...
...
bin/test
View file @
f8632a74
...
...
@@ -105,14 +105,12 @@ testBuildWithCache() {
testModulesCheckedIn
()
{
compile
"modules-checked-in"
assertCaptured
"node_modules source: prebuilt"
assertCaptured
"(preinstall script)"
assertCaptured
"Rebuilding any native modules for this architecture"
assertCaptured
"(preinstall script)"
assertCaptured
"Installing any new modules"
assertCaptured
"(postinstall script)"
assertNotCaptured
"Restoring node modules"
assertNotCaptured
"Pruning unused dependencies"
assertNotCaptured
"Installing any new modules"
assertNotCaptured
"Installing node modules"
assertNotCaptured
"Deduping dependency tree"
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