#NEWLINE# def runNpmInstall( wd = None , dev = False , npm = 'npm' ) : #NEWLINE# #INDENT# '\n    Use this to run `npm install` inside the package.\n    ' #NEWLINE# wd = ( wd or constants . PACKAGE_DIR ) #NEWLINE# args = ( ( npm , 'install' , '--production' , '--unsafe-perm' ) if ( not dev ) else ( npm , 'install' , '--unsafe-perm' ) ) #NEWLINE# proc = subprocess . Popen ( args , cwd = wd ) #NEWLINE# proc . communicate ( ) #NEWLINE# if ( proc . returncode != 0 ) : #NEWLINE# #INDENT# raise Exception ( ( 'Web client install failed: npm install returned %s.' % proc . returncode ) )