def node_prereqs_installation():
 cb_error_text = 'Subprocess return code: 1'
 sh('test `npm config get registry` = "{reg}" || (echo setting registry; npm config set registry {reg})'.format(reg=NPM_REGISTRY))
 try:
  sh('npm install')
 except BuildFailure as error_text:
  if (cb_error_text in error_text):
   print 'npm install error detected. Retrying...'
   sh('npm install')
  else:
   raise BuildFailure(error_text)

def node_prereqs_installation ( ) : cb_error_text = 'Subprocess return code: 1' sh ( 'test `npm config get registry` = "{reg}" || (echo setting registry; npm config set registry {reg})' . format ( reg = NPM_REGISTRY ) ) try : sh ( 'npm install' ) except BuildFailure as error_text : if ( cb_error_text in error_text ) : print 'npm install error detected. Retrying...' sh ( 'npm install' ) else : raise BuildFailure ( error_text )
configures npm and installs node prerequisites .