Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
Calling a node js function or script in python

I'm trying to run a node js script from my main.py file in which there are other functions from different files. My main goal is that in one main.py file to run all the functions that I need for my application. I tried to use js2py but it crashed with an error:

raise Ecma51NotSupported('ArrowFunctionExpression')
pyjsparser.std_nodes.Ecma51NotSupported: ArrowFunctionExpression is not supported by ECMA 5.1.

I have also tried to use Naked but that also crashed. I don't need any data from this node js file or anything just to run either all script or one function that it has. In best case scenario it would work just like with .py files: from python_file import do_some_work
do_some_work()

Any suggestions or fix ?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The error is quite clear, you're using arrow functions ((param) => expression) which are not supported in ECMAScript 5 standard, which is the one used by defualt in js2py.

According to the author, latest versions now support ES6 evaluation by using eval_js6 (source).

So it's either removing the arrow functions and sticking to ES5 or trying this function to run the code.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Running whole node js script from main.py using import os and os.system('node file.js') did the job!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda