   # Remove any deploy configuration, just to be sure
   delete config.deploy
 
+  # Make sure the latest npm gets installed
+  prependToTravisConfigProperty(config, 'before_install', 'npm install -g npm@latest')
+
   # Enhance the build configuration so it reports results back to PR and deletes
   # the branch afterwards.
   command = createStatusCommand(testedCommit,

  return expressions.join(' -and ')


# Replaces given pattern with replacement in given file. Returns boolean whether
# any changes were made.
replaceDreddInstallation = ->
  contents = fs.readFileSync(TRAVIS_CONFIG_FILE, 'utf-8')


TRAVIS_CONFIG_FILE = '.travis.yml'
LINKED_DREDD_DIR = './__dredd__'
RE_DREDD_INSTALL_CMD = /npm ([ \-=\w]+ )?i(nstall)? ([ \-=\w]+ )?dredd(@\w+)?/
DREDD_LINK_CMD = "npm link --python=python2 #{LINKED_DREDD_DIR}"


