#NEWLINE# def run_npm( self , env_dir ) : #NEWLINE# #INDENT# package_file = os . path . join ( self . project_dir , 'package.json' ) #NEWLINE# try : #NEWLINE# #INDENT# package = json . load ( open ( package_file ) ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# logger . warning ( "Could not find 'package.json', ignoring NPM dependencies." ) #NEWLINE# return #NEWLINE# #UNINDENT# for ( name , version ) in package . get ( 'dependencies' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . items ( ) : #NEWLINE# #INDENT# dep_name = ( '%s@%s' % ( name , version ) ) #NEWLINE# self . run_cmd ( [ 'npm' , 'install' , '-g' , dep_name ] , self . project_dir )