Skip to content

Commit

Permalink
Install package.json dependencies missing from vendored node_modules
Browse files Browse the repository at this point in the history
[#94525966]
  • Loading branch information
crawsible committed May 22, 2015
1 parent 1aec8fa commit 24d68bd
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions cf_spec/integration/deploy_a_node_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@
end
end

context 'with an incomplete node_modules directory' do
let (:app_name) { 'node_web_app_with_incomplete_node_modules' }

it 'downloads missing dependencies from package.json' do
expect(app).to be_running
expect(Dir).to_not exist("cf_spec/fixtures/node_web_app_with_incomplete_node_modules/node_modules/hashish")
expect(app).to have_file("app/node_modules/hashish")
expect(app).to have_file("app/node_modules/express")
end
end

context 'with an incomplete package.json' do
let (:app_name) { 'node_web_app_with_incomplete_package_json' }

Expand Down
2 changes: 2 additions & 0 deletions lib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ function build_dependencies() {
elif [ "$modules_source" == "prebuilt" ]; then
info "Rebuilding any native modules for this architecture"
npm rebuild 2>&1 | indent
info "Installing any new modules"
npm install --unsafe-perm --quiet --userconfig $build_dir/.npmrc 2>&1 | indent

else
restore_cache
Expand Down

0 comments on commit 24d68bd

Please sign in to comment.