首页 > 编程知识 正文

c语言执行exe错误,执行cl exe时出错

时间:2023-05-06 05:37:13 阅读:275234 作者:208

Traceback (most recent call last): File "test_js.py", line 12, in <module> res = js.call("test") File "/usr/local/python3/lib/python3.7/site-packages/execjs/_abstract_runtime_context.py", line 37, in call return self._call(name, *args) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_external_runtime.py", line 92, in _call return self._eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args)) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_external_runtime.py", line 78, in _eval return self.exec_(code) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_abstract_runtime_context.py", line 18, in exec_ return self._exec_(source) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_external_runtime.py", line 85, in _exec_ output = self._exec_with_tempfile(source) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_external_runtime.py", line 127, in _exec_with_tempfile self._fail_on_non_zero_status(ret, stdoutdata, stderrdata) File "/usr/local/python3/lib/python3.7/site-packages/execjs/_external_runtime.py", line 134, in _fail_on_non_zero_status raise ProcessExitedWithNonZeroStatus(status=status, stdout=stdoutdata, stderr=stderrdata)execjs._exceptions.ProcessExitedWithNonZeroStatus: (101, '', '/tmp/execjsextscsjc.js:2:0 Expected an operand but found constnconst s=()=>Array.form({length:16}).,ap(()=>Math.round(61*Math.random()));n^n/tmp/execjsextscsjc.js:2:34 Expected ; but found )nconst s=()=>Array.form({length:16}).,ap(()=>Math.round(61*Math.random()));n ^n/tmp/execjsextscsjc.js:5:0 Expected an operand but found constnconst e = s();n^n')

在centos环境执行执行py文件的时候,嵌入了js代码段,执行报错如上,原因可能是因为没有安装node环境,

安装node环境应该就好了,下面为安装node环境

wget https://nodejs.org/dist/v10.8.0/node-v10.8.0-linux-x64.tar.gztar -xzvf node-v10.8.0-linux-x64.tar.gzmv node-v10.8.0-linux-x64.tar.gz nodecd node/binpwd //获取当前路径vim ~/.bash_profile //配置环境变量 export PATH=$PATH:/root/node/binsource ~/.bash_profile

配置好以上环境,再次执行成功!如果还是不成功,尝试断开连接,重新连接试一下,说不定就可以了呢!!!

如果windows或者ios报类似的错误,先检查有没有安装node,并配置好环境变量!

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。