gpt4 book ai didi

node.js - 编译node.js出现 "NameError: global name '文件'未定义”

转载 作者:太空宇宙 更新时间:2023-11-03 23:10:22 24 4
gpt4 key购买 nike

我有 python2 和 python3,我运行 ./configure 并且它有效。但是我运行 make,

make -C out BUILDTYPE=Release V=1make[1]: Entering directory `/home/colin4124/MyProgram/node/out'  LD_LIBRARY_PATH=/home/colin4124/MyProgram/node/out/Release/lib.host:/home/colin4124/MyProgra>m/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/tools/gyp; mkdir -p /home/colin4124/MyProgram/node/out/Release/obj/gen; python ../../tools/gen-postmortem-metadata.py "/home/colin4124/MyProgram/node/out/Release/obj/gen/debug-support.cc" ../../src/objects.h ../../src/objects-inl.hTraceback (most recent call last):  File "../../tools/gen-postmortem-metadata.py", line 479, in     emit_config();  File "../../tools/gen-postmortem-metadata.py", line 432, in emit_config    out = file(sys.argv[1], 'w');NameError: global name 'file' is not definedmake[1]: *** [/home/colin4124/MyProgram/node/out/Release/obj/gen/debug-support.cc] Error 1make[1]: Leaving directory `/home/colin4124/MyProgram/node/out'make: *** [node] Error 2

我该如何解决这个问题,想想吧!!

最佳答案

看起来您的默认 Python 是 3.x,但 Node 构建脚本需要 Python 2.x。

根据these instructions您可以通过将 PYTHON 环境变量设置为指向 Python 2 可执行文件来修复它:

export PYTHON=`which python2`

关于node.js - 编译node.js出现 "NameError: global name '文件'未定义”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15571236/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com