Python - Node.js (V8) runtime is not available on this system

。_饼干妹妹 提交于 2019-12-10 03:10:42

问题


I'm getting the following error when trying to use ExecJS:

execjs.RuntimeUnavailable: Node.js (V8) runtime is not available on this system

I have node.js installed on my machine (Ubuntu 14.04). Which Node outputs /usr/bin/node

Any ideas?


回答1:


Have you seen this similar issue

They resolve the problem by linking node under /usr/local/bin/node

ln -s /usr/local/bin/node /usr/bin/node



回答2:


Hello I've had the same issue before and this solved it:

Node.js not found by Rails / execjs

PS: if this solves you issue mark my answer as correct! :P




回答3:


When you are trying to use ExecJS, what user are you trying to run as? the ENV path for node may be not be available to the account which is trying to execute the ExecJS. May be this could be a dumb idea but have you tried re-installing nodejs?

sudo apt-get install nodejs




回答4:


To get some insight what's happening, you might want to try "strace yourapp" (system call tracer), or strace -p $PID , (-f helps following forks) then grep the output for node. You will see what it was trying to open/start before throwing the error.

That way you will have something to look for in configuration or environment, that must be changed to the path your node could really be found.




回答5:


Make sure you really have file /usr/bin/node. If it is a symlink, make sure the target is exists and valid.

I know that which node gave you the result but just make sure it's same in the python's environtment.

print os.environ.get('PATH', '')

And make sure your /usr/bin/node is executable by current user.

$ node --version


来源:https://stackoverflow.com/questions/31991263/python-node-js-v8-runtime-is-not-available-on-this-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!