staging/lib/vcap/staging/plugin/node/npm_support/npm_support.rb
def should_install_packages?
    return unless @dependencies

    return true if @vcap_config["ignoreNodeModules"]

    user_packages_dir = File.join(destination_directory, "app", "node_modules")
    !File.exists?(user_packages_dir)
  end
# If there is no npm-shwrinkwrap.json file don't do anything
# If user has node_modules folder and config option "ignoreNodeModules"
# in cloudfoundry.json is not set don't do anything
# Otherwise, install node modules according to shwrinkwrap.json tree
#
# For each dependency in shrinkwrap tree recursively:
# - Get from cache by name & version
# - If not in cache, fetch it, run npm rebuild, put in cache
If there is no npm-shwrinkwrap.json file don't do anything
If user has node_modules folder and config option "ignoreNodeModules"
in cloudfoundry.json is not set don't do anything
Otherwise, install node modules according to shwrinkwrap.json tree

For each dependency in shrinkwrap tree recursively:
Get from cache by name & version
If not in cache, fetch it, run npm rebuild, put in cache
If there is no npm - shwrinkwrap . json file don ' t do anything If user has node_modules folder and config option " ignoreNodeModules " in cloudfoundry . json is not set don ' t do anything Otherwise install node modules according to shwrinkwrap . json tree For each dependency in shrinkwrap tree recursively : Get from cache by name & version If not in cache fetch it run npm rebuild put in cache
def should_install_packages?
    return unless @dependencies
    return true if @vcap_config["ignoreNodeModules"]
    user_packages_dir = File.join(destination_directory, "app", "node_modules")
    !File.exists?(user_packages_dir)
  end
def should_install_packages? return unless @dependencies return true if @vcap_config [ "ignoreNodeModules" ] user_packages_dir = File . join ( destination_directory , "app" , "node_modules" ) ! File . exists? ( user_packages_dir ) end
If there is no npm-shwrinkwrap.json file don't do anything
If user has node_modules folder and config option "ignoreNodeModules"
in cloudfoundry.json is not set don't do anything
Otherwise, install node modules according to shwrinkwrap.json tree
If there is no npm - shwrinkwrap . json file don ' t do anything If user has node_modules folder and config option " ignoreNodeModules " in cloudfoundry . json is not set don ' t do anything Otherwise install node modules according to shwrinkwrap . json tree