<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def run(self):
        '''compile the JS, then run superclass implementation'''

        if subprocess.call(['npm', '--version']) != 0:
            raise RuntimeError('npm is required to build the HTML renderer.')

        self.check_call(['npm', 'install'], cwd=HTML_RENDERER_DIR)
        self.check_call(['npm', 'run', 'build'], cwd=HTML_RENDERER_DIR)

        self.copy_file(HTML_RENDERER_DIR+'/dist/js/app.js', 'pyinstrument/renderers/html_resources/app.js')

        setuptools.command.build_py.build_py.run(self)