def run_npm(self, env_dir):
        package_file = os.path.join(self.project_dir, 'package.json')
        try:
            package = json.load(open(package_file))
        except __HOLE__:
            logger.warning("Could not find 'package.json', ignoring NPM "
                           "dependencies.")
            return

        for name, version in package.get('dependencies', {}).items():
            # packages are installed globally to make sure that they are
            # installed in the virtualenv rather than the current directory.
            # it is also necessary for packages containing scripts, e.g. less
            dep_name = '%s@%s' % (name, version)
            self.run_cmd(['npm', 'install', '-g', dep_name], self.project_dir)
dataset/ETHPy150Open elbaschid/virtual-node/setup.py/node_build.run_npm