PyExecJS Runtime Error: Could not find an available JavaScript runtime.

Error message:

Here Insert Picture Description

My server is CentOS
Here Insert Picture Description

I use Python + Tornado project to build, deploy and finally encountered js running on the server error, said the Internet is not installed nodejs, so I installed the following steps to restart the process supervisorctl service, and then run smoothly

solution

Sequentially mounting nodejs, follow the steps below

Step 1: Install gcc-c ++

yum install -y gcc-c++ make

Step two: Download and install the node

curl -sL https://rpm.nodesource.com/setup_6.x | sudo -E bash -

Step 3: Install nodejs

yum install nodejs

Step four: Verify node is installed correctly

node -v

Export

v6.17.1

View npm version

npm -v 

Export

3.10.10

The final step: Restart your project management processes where the supervisor

supervisorctl restart myProjectName

View the status of the process and then run

supervisorctl status

Export

myProjectName        RUNNING   pid 16050, uptime 0:12:30

If you or error, it may need to import node environment variable
to view the path node where the command

which node

Export

/usr/bin/node

This node is then introduced into the environment variable path

export EXECJS_RUNTIME=/usr/bin/node

Again to restart the supervisor of your project process


You're done, try to use the function module PyExecJS it your project! Absolutely!

Leave your thumbs, bloggers will share more

Published 345 original articles · won praise 130 · views 670 000 +

Guess you like

Origin blog.csdn.net/u013538542/article/details/104640171