Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!