prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Typescript checks don't work on circle CI
  <!--
    - Thanks for taking the time to report a bug in the Oppia project.
    - Before filing a new issue, please do a quick search to check that it hasn't
    - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._
    -->
  
  **Describe the bug**
  Typescript checks don't work on circle CI
  
  **To Reproduce**
  Steps to reproduce the behavior:
  1. See logs on any pull request.
  
  **Observed behavior**
  ```
  Compiling and testing typescript...
  /usr/bin/env: ‘node’: No such file or directory
  Compilation successful!
  ```
  
  **Expected behavior**
  They should run.
  
  
  </issue>
  <code>
  [start of scripts/typescript_checks.py]
  1 # Copyright 2019 The Oppia Authors. All Rights Reserved.
  2 #
  3 # Licensed under the Apache License, Version 2.0 (the "License");
  4 # you may not use this file except in compliance with the License.
  5 # You may obtain a copy of the License at
  6 #
  7 #      http://www.apache.org/licenses/LICENSE-2.0
  8 #
  9 # Unless required by applicable law or agreed to in writing, software
  10 # distributed under the License is distributed on an "AS-IS" BASIS,
  11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12 # See the License for the specific language governing permissions and
  13 # limitations under the License.
  14 
  15 """File for compiling and checking typescript."""
  16 
  17 from __future__ import absolute_import  # pylint: disable=import-only-modules
  18 from __future__ import unicode_literals  # pylint: disable=import-only-modules
  19 
  20 import json
  21 import os
  22 import shutil
  23 import subprocess
  24 import sys
  25 
  26 import python_utils
  27 
  28 COMPILED_JS_DIR = os.path.join('local_compiled_js_for_test', '')
  29 TSCONFIG_FILEPATH = 'tsconfig.json'
  30 
  31 
  32 def validate_compiled_js_dir():
  33     """Validates that compiled js dir matches out dir in tsconfig."""
  34     with python_utils.open_file(TSCONFIG_FILEPATH, 'r') as f:
  35         config_data = json.load(f)
  36         out_dir = os.path.join(config_data['compilerOptions']['outDir'], '')
  37     if out_dir != COMPILED_JS_DIR:
  38         raise Exception(
  39             'COMPILED_JS_DIR: %s does not match the output directory '
  40             'in %s: %s' % (COMPILED_JS_DIR, TSCONFIG_FILEPATH, out_dir))
  41 
  42 
  43 def compile_and_check_typescript():
  44     """Compiles typescript files and checks the compilation errors."""
  45     node_path = os.path.join(os.pardir, 'oppia_tools/node-10.18.0')
  46     os.environ['PATH'] = '%s/bin:' % node_path + os.environ['PATH']
  47 
  48     validate_compiled_js_dir()
  49 
  50     if os.path.exists(COMPILED_JS_DIR):
  51         shutil.rmtree(COMPILED_JS_DIR)
  52 
  53     python_utils.PRINT('Compiling and testing typescript...')
  54     cmd = [
  55         './node_modules/typescript/bin/tsc', '--project',
  56         TSCONFIG_FILEPATH]
  57     process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  58     error_messages = []
  59     for line in iter(process.stdout.readline, ''):
  60         error_messages.append(line)
  61     if os.path.exists(COMPILED_JS_DIR):
  62         shutil.rmtree(COMPILED_JS_DIR)
  63     if error_messages:
  64         python_utils.PRINT('Errors found during compilation\n')
  65         for message in error_messages:
  66             python_utils.PRINT(message)
  67         sys.exit(1)
  68     else:
  69         python_utils.PRINT('Compilation successful!')
  70 
  71 
  72 # The 'no coverage' pragma is used as this line is un-testable. This is because
  73 # it will only be called when typescript_checks.py is used as a script.
  74 if __name__ == '__main__':  # pragma: no cover
  75     compile_and_check_typescript()
  76
  [end of scripts/typescript_checks.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/scripts/typescript_checks.py b/scripts/typescript_checks.py
  --- a/scripts/typescript_checks.py
  +++ b/scripts/typescript_checks.py
  @@ -24,6 +24,7 @@
   import sys
   
   import python_utils
  +from . import common
   
   COMPILED_JS_DIR = os.path.join('local_compiled_js_for_test', '')
   TSCONFIG_FILEPATH = 'tsconfig.json'
  @@ -42,7 +43,7 @@
   
   def compile_and_check_typescript():
       """Compiles typescript files and checks the compilation errors."""
  -    node_path = os.path.join(os.pardir, 'oppia_tools/node-10.18.0')
  +    node_path = common.NODE_PATH
       os.environ['PATH'] = '%s/bin:' % node_path + os.environ['PATH']
   
       validate_compiled_js_dir()
  
verification_info: {"golden_diff": "diff --git a/scripts/typescript_checks.py b/scripts/typescript_checks.py\n--- a/scripts/typescript_checks.py\n+++ b/scripts/typescript_checks.py\n@@ -24,6 +24,7 @@\n import sys\n \n import python_utils\n+from . import common\n \n COMPILED_JS_DIR = os.path.join('local_compiled_js_for_test', '')\n TSCONFIG_FILEPATH = 'tsconfig.json'\n@@ -42,7 +43,7 @@\n \n def compile_and_check_typescript():\n     \"\"\"Compiles typescript files and checks the compilation errors.\"\"\"\n-    node_path = os.path.join(os.pardir, 'oppia_tools/node-10.18.0')\n+    node_path = common.NODE_PATH\n     os.environ['PATH'] = '%s/bin:' % node_path + os.environ['PATH']\n \n     validate_compiled_js_dir()\n", "issue": "Typescript checks don't work on circle CI\n<!--\r\n  - Thanks for taking the time to report a bug in the Oppia project.\r\n  - Before filing a new issue, please do a quick search to check that it hasn't\r\n  - already been filed on the [issue tracker](https://github.com/oppia/oppia/issues)._\r\n  -->\r\n\r\n**Describe the bug**\r\nTypescript checks don't work on circle CI\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. See logs on any pull request.\r\n\r\n**Observed behavior**\r\n```\r\nCompiling and testing typescript...\r\n/usr/bin/env: \u2018node\u2019: No such file or directory\r\nCompilation successful!\r\n```\r\n\r\n**Expected behavior**\r\nThey should run.\r\n\n", "before_files": [{"content": "# Copyright 2019 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"File for compiling and checking typescript.\"\"\"\n\nfrom __future__ import absolute_import  # pylint: disable=import-only-modules\nfrom __future__ import unicode_literals  # pylint: disable=import-only-modules\n\nimport json\nimport os\nimport shutil\nimport subprocess\nimport sys\n\nimport python_utils\n\nCOMPILED_JS_DIR = os.path.join('local_compiled_js_for_test', '')\nTSCONFIG_FILEPATH = 'tsconfig.json'\n\n\ndef validate_compiled_js_dir():\n    \"\"\"Validates that compiled js dir matches out dir in tsconfig.\"\"\"\n    with python_utils.open_file(TSCONFIG_FILEPATH, 'r') as f:\n        config_data = json.load(f)\n        out_dir = os.path.join(config_data['compilerOptions']['outDir'], '')\n    if out_dir != COMPILED_JS_DIR:\n        raise Exception(\n            'COMPILED_JS_DIR: %s does not match the output directory '\n            'in %s: %s' % (COMPILED_JS_DIR, TSCONFIG_FILEPATH, out_dir))\n\n\ndef compile_and_check_typescript():\n    \"\"\"Compiles typescript files and checks the compilation errors.\"\"\"\n    node_path = os.path.join(os.pardir, 'oppia_tools/node-10.18.0')\n    os.environ['PATH'] = '%s/bin:' % node_path + os.environ['PATH']\n\n    validate_compiled_js_dir()\n\n    if os.path.exists(COMPILED_JS_DIR):\n        shutil.rmtree(COMPILED_JS_DIR)\n\n    python_utils.PRINT('Compiling and testing typescript...')\n    cmd = [\n        './node_modules/typescript/bin/tsc', '--project',\n        TSCONFIG_FILEPATH]\n    process = subprocess.Popen(cmd, stdout=subprocess.PIPE)\n    error_messages = []\n    for line in iter(process.stdout.readline, ''):\n        error_messages.append(line)\n    if os.path.exists(COMPILED_JS_DIR):\n        shutil.rmtree(COMPILED_JS_DIR)\n    if error_messages:\n        python_utils.PRINT('Errors found during compilation\\n')\n        for message in error_messages:\n            python_utils.PRINT(message)\n        sys.exit(1)\n    else:\n        python_utils.PRINT('Compilation successful!')\n\n\n# The 'no coverage' pragma is used as this line is un-testable. This is because\n# it will only be called when typescript_checks.py is used as a script.\nif __name__ == '__main__':  # pragma: no cover\n    compile_and_check_typescript()\n", "path": "scripts/typescript_checks.py"}]}