简体   繁体   English

nodeenv无法安装node.js

[英]nodeenv cannot install node.js

On RedHat Enterprise 7, trying to install node.js inside of a nodeenv ( 0.13.6 ) in a Python virtual environment (Python 2.7). 在RedHat Enterprise 7上,尝试在Python虚拟环境(Python 2.7)中的nodeenv( 0.13.6 )内安装node.js。 When I do nodeenv -p , I get OSError: Command make --jobs=2 failed with error code 2 ...googling, the only reference to this is here . 当我执行nodeenv -p ,出现OSError: Command make --jobs=2 failed with error code 2 ...谷歌搜索,对此的唯一引用是在这里 Not super useful for me, because I am already trying to install the newest version of node (4.2.1). 对我来说不是超级有用,因为我已经在尝试安装最新版本的node(4.2.1)。 Full trace of this is below: 完整的跟踪信息如下:

$ nodeenv -p
 * Install node (4.2.1..Traceback (most recent call last):
  File "/usr/local/pythonenvs/producer/bin/nodeenv", line 11, in <module>
    sys.exit(main())
  File "/usr/local/pythonenvs/producer/lib/python2.7/site-packages/nodeenv.py", line 891, in main
    create_environment(env_dir, opt)
  File "/usr/local/pythonenvs/producer/lib/python2.7/site-packages/nodeenv.py", line 732, in create_environment
    install_node(env_dir, src_dir, opt)
  File "/usr/local/pythonenvs/producer/lib/python2.7/site-packages/nodeenv.py", line 608, in install_node
    build_node_from_src(env_dir, src_dir, node_src_dir, opt)
  File "/usr/local/pythonenvs/producer/lib/python2.7/site-packages/nodeenv.py", line 577, in build_node_from_src
    callit([make_cmd] + make_opts, opt.verbose, True, node_src_dir, env)
  File "/usr/local/pythonenvs/producer/lib/python2.7/site-packages/nodeenv.py", line 461, in callit
    % (cmd_desc, proc.returncode))
OSError: Command make --jobs=2 failed with error code 2

I then tried to install from prebuilt, using the instructions in this GitHub issue . 然后,我尝试使用此GitHub问题中的说明从预建版本进行安装。

nodeenv -p --prebuilt

That seemed to work... 那似乎行得通...

 * Install node (4.2.1... done.
 * Appending data to /usr/local/pythonenvs/producer/bin/activate

Except nothing actually installed -- tab completing shows no node or npm install (I have deactivated and re-activated the virtual environment): 除非实际未安装任何东西-选项卡完成不显示任何nodenpm安装(我已停用并重新激活了虚拟环境):

$ no
nodeenv      nohup        nologin      notify-send
$ np
$ nproc

My other installs worked with the same instructions, so I'm at a loss for debugging this. 我的其他安装也按照相同的说明进行操作,因此调试此命令我无所适从。 Any hints or suggestions? 有任何提示或建议吗? If this is a permissions issue, where do I need to set / change them? 如果这是权限问题,我需要在哪里设置/更改它们? The user already owns the virtual environment directory... 用户已经拥有虚拟环境目录...

Okay, so I don't have a solution to the root cause (I suspect some sort of issue / conflict with make on my server), but I managed to get it installed via --prebuilt . 好的,因此我没有根本原因的解决方案(我怀疑服务器上的make存在某种问题/冲突),但是我设法通过--prebuilt安装了它。 I had to manually delete the node.js source from /usr/local/pythonenvs/producer/src/node-v4.2.1/ , because the --prebuilt option was trying to copy those as if they were binaries. 我不得不从/usr/local/pythonenvs/producer/src/node-v4.2.1/手动删除node.js源代码,因为--prebuilt选项试图将它们复制为二进制文件。 After deleting the directory, I downloaded / extracted from nodejs.org into the virtual environment's src directory. 删除目录后,我从nodejs.org下载/解压缩到虚拟环境的src目录中。 Then, the nodeenv -p --prebuilt command works fine. 然后, nodeenv -p --prebuilt命令可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM