【问题标题】:I cant install NODEJS in CENTOS... why?我无法在 CENTOS 中安装 NODEJS……为什么?
【发布时间】:2013-04-05 03:03:22
【问题描述】:

我得到了一个具有 NODEJS 的 .configure 的版本(node-v0.8.3),因为最新版本没有 .configue o make 或 makeintall ..(刚刚找到使用 ./configue 的“操作方法”)...我的服务器是 CENTOS 5.. 我想安装 NODEJS.. 需要帮助!我遇到以下错误:

xxx@xxx [/usr/local/src/node-v0.8.3]# ./configure
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'host_arch': 'x64',
                 'node_install_npm': 'true',
                 'node_install_waf': 'true',
                 'node_prefix': '',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'false',
                 'node_shared_zlib': 'false',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'false',
                 'node_use_openssl': 'true',
                 'target_arch': 'x64',
                 'v8_no_strict_aliasing': 1,
                 'v8_use_snapshot': 'true'}}
creating  ./config.gypi
Traceback (most recent call last):
  File "./configure", line 400, in <module>
    pprint.pformat(output, indent=2) + "\n")
  File "./configure", line 396, in write
    f = open(filename, 'w+')
IOError: [Errno 13] Permission denied: './config.gypi'

怎么了?

【问题讨论】:

  • 您是否使用 sudo 安装?
  • 如何 sudo ./configure?给出语法错误
  • 在提示符下输入 sudo configure ,应该可以工作
  • sudo:配置:找不到命令
  • 您的系统上安装了哪个版本的 Python(请咨询python -V)? Node 构建脚本需要 Python 2.6 或 2.7(可能 2.5,绝对不是 3.x)。

标签: node.js centos5


【解决方案1】:

我对 linux 一无所知...但我确实成功使用了这些命令:

1: me@server.com [/]# cd ~
2: me@server.com [~]# mkdir node
3: me@server.com [~]# cd node
4: me@server.com [~/node]# wget http://nodejs.org/dist/v0.10.4/node-v0.10.4.tar.gz
5: me@server.com [~/node]# tar zxvf node-v0.10.4.tar.gz
6: me@server.com [~/node]# cd node-v0.10.4
7: me@server.com [~/node/node-v0.10.4]# ./configure
8: me@server.com [~/node/node-v0.10.4]# make
9: me@server.com [~/node/node-v0.10.4]# make install

我在 Centos 5 中遇到权限错误...感谢所有提供帮助的人!

【讨论】:

  • 仅供参考,您确实应该以普通用户身份运行除#9 之外的所有命令。不需要以 root 身份运行所有内容,这会使您的系统面临额外的风险。
  • 运行 ./configure - File "./configure", line 433 fpu = 'vfpv3' if armv7 else 'vfpv2' SyntaxError: invalid syntax 时出现语法错误。为什么在 CentOS 上安装 NodeJS 这么难?
  • 其实configure文件是一个python脚本,需要安装python 2.7.x才能运行
猜你喜欢
  • 2021-10-18
  • 2016-10-20
  • 2016-08-17
  • 2021-09-08
  • 1970-01-01
  • 2022-11-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多