2016-08-03 12 views
1

をインストールし、私はnodegitのインストールNPMの間に、次のエラーを得た:は、NPMの間にlibssh2の中で「Cコンパイラが実行可能ファイルを作成することはできません」

> [email protected] preinstall /home/mhu/nodegit 
> node lifecycleScripts/preinstall 

[nodegit] Running pre-install script 
[nodegit] [email protected] installed, pre-loading required packages 
[nodegit] Configuring libssh2. 
{ [Error: Command failed: /bin/sh -c /home/mhu/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl 
configure: error: in `/home/mhu/nodegit/vendor/libssh2': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
] 
    killed: false, 
    code: 77, 
    signal: null, 
    cmd: '/bin/sh -c /home/mhu/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl' } 
configure: error: in `/home/mhu/nodegit/vendor/libssh2': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 

[nodegit] ERROR - Could not finish preinstall 
{ [Error: Command failed: /bin/sh -c /home/mhu/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl 
configure: error: in `/home/mhu/nodegit/vendor/libssh2': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 
] 
    killed: false, 
    code: 77, 
    signal: null, 
    cmd: '/bin/sh -c /home/mhu/nodegit/vendor/libssh2/configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl' } 

誰かがこれで私を助けることができますか?これは、Cコンパイラが実行可能ファイルを作成できるようにするための許可の問題のためですか?

私の環境:

OS:centos-release-6-8.el6.centos.12.3.x86_64

GCC:4.9.1

のopenssl:openssl-1.0.1e-48.el6.x86_64

libssh2の:libssh2-1.4.2-2.el6_7.1.x86_64

ノード:v4.4.7

NPM:2.15.8

gcc -vができます:ここで

Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/packages/encap/gcc-4.9.1/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper 
Target: x86_64-unknown-linux-gnu 
Configured with: ../gcc-4.9.1/configure --enable-languages=c,c++,fortran --enable-shared --disable-libstdcxx-pch --enable-lto --enable-libgomp --enable-__cxa_atexit --enable-tls --with-gmp --with-mpfr --with-mpc --with-libelf 
Thread model: posix 
gcc version 4.9.1 (GCC) 

はエラーになります/ホーム/ MHU/nodegit /ベンダー/ libssh2の中config.logの中に一部です:

configure:3429: $? = 0 
configure:3418: gcc -v >&5 
Using built-in specs. 
COLLECT_GCC=gcc 
COLLECT_LTO_WRAPPER=/packages/encap/gcc-4.9.1/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper 
Target: x86_64-unknown-linux-gnu 
Configured with: ../gcc-4.9.1/configure --enable-languages=c,c++,fortran --enable-shared --disable-libstdcxx-pch --enable-lto --enable-libgomp --enable-__cxa_atexit --enable-tls --with-gmp --with-mpfr --with-mpc --with-libelf 
Thread model: posix 
gcc version 4.9.1 (GCC) 
configure:3429: $? = 0 
configure:3418: gcc -V >&5 
gcc: error: unrecognized command line option '-V' 
gcc: fatal error: no input files 
compilation terminated. 
configure:3429: $? = 1 
configure:3418: gcc -qversion >&5 
gcc: error: unrecognized command line option '-qversion' 
gcc: fatal error: no input files 
compilation terminated. 
configure:3429: $? = 1 
configure:3449: checking whether the C compiler works 
configure:3471: gcc -I/home/mhu/nodegit/vendor/openssl/openssl/include conftest.c >&5 
/usr/bin/ld: unrecognized option '-plugin' 
/usr/bin/ld: use the --help option for usage information 
collect2: error: ld returned 1 exit status 
configure:3475: $? = 1 
configure:3513: result: no 
configure: failed program was: 
| /* confdefs.h */ 
| #define PACKAGE_NAME "libssh2" 
| #define PACKAGE_TARNAME "libssh2" 
| #define PACKAGE_VERSION "-" 
| #define PACKAGE_STRING "libssh2 -" 
| #define PACKAGE_BUGREPORT "[email protected]" 
| #define PACKAGE_URL "" 
| #define PACKAGE "libssh2" 
| #define VERSION "-" 
| /* end confdefs.h. */ 
| 
| int 
| main() 
| { 
| 
| ; 
| return 0; 
| } 
configure:3518: error: in `/home/mhu/nodegit/vendor/libssh2': 
configure:3520: error: C compiler cannot create executables 
See `config.log' for more details 
+0

あなたのCPUアーキテクチャ用にコンパイラがインストールされていないようですね?あなたの質問に 'gcc -v'の完全な出力を含めることができますか? – mscdex

+0

また、 'CC'環境変数が設定されていますか(' echo $ CC')? – mscdex

+0

@mscdexいいえ$ CCを設定しませんでした。 –

答えて

1

からconfig.log、問題は次のとおりです。

/usr/bin/ld: unrecognized option '-plugin' 

これはあいまいなエラーのようです。 Stack Overflowに関する2つの質問で議論されています。最も有望な質問はHow to fix “unrecognized option '-plugin`” when using gdc to compile D program?です。あなたが希望、Autotool群の世界では、次に

export CPPFLAGS="-fno-use-linker-plugin" 
export CFLAGS="-fno-use-linker-plugin" 
export CXXFLAGS="-fno-use-linker-plugin" 

は(config.logや友人を生産)Autotool群でこれを修正するには、次の操作を行う必要があり

./configure --with-libssl-prefix=/home/mhu/nodegit/vendor/openssl/openssl ... 

することができますコンパイラにフラグを追加することで時折回避できます。

export CC=gcc -fno-use-linker-plugin 
export CXX=g++ -fno-use-linker-plugin 

残念ながら、th私の知識が終わるところで。 npmのために何をすべきかわかりません。これは答えのための質問のように見えます:How to pass options to dependent package installs?

関連する問題