项目中要使用图片验证 码,使用了npm上的轻量级ccap模块,开发环境上安装正常,到了发布环境上,怎么也装不上。系统输出如下: ` [root@localhost QAVA]# npm install -g ccap
ccap@0.6.0 preinstall /usr/local/n/versions/node/0.12.2/lib/node_modules/ccap node make.js
I’m glad you to select ccap, enjoy it!
ccap is a cross plat form and portable nodejs simple captcha module, simple api and lightweight.
starting compile ccap! good luck! \
ccap@0.6.0 install /usr/local/n/versions/node/0.12.2/lib/node_modules/ccap node-gyp rebuild
Traceback (most recent call last):
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py”, line 18, in <module>
sys.exit(gyp.script_main())
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 534, in script_main
return main(sys.argv[1:])
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 527, in main
return gyp_main(args)
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 503, in gyp_main
options.circular_check)
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/init.py”, line 129, in Load
params[‘parallel’], params[‘root_targets’])
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 2692, in Load
variables, includes, depth, check, True)
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 362, in LoadTargetBuildFile
includes, True, check)
File “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py”, line 219, in LoadOneBuildFile
None)
File “binding.gyp”, line 1
{
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 2.6.32-220.el6.x86_64
gyp ERR! command “node” “/usr/local/n/versions/node/0.12.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /usr/local/n/versions/node/0.12.2/lib/node_modules/ccap
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Linux 2.6.32-220.el6.x86_64
npm ERR! argv “/usr/local/n/versions/node/0.12.2/bin/node” “/usr/local/n/versions/node/0.12.2/bin/npm” “install” “-g” "ccap"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! ccap@0.6.0 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ccap@0.6.0 install script ‘node-gyp rebuild’.
npm ERR! This is most likely a problem with the ccap package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls ccap
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /opt/deploy/QAVA/npm-debug.log [root@localhost QAVA]# g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/opt/centos/devtoolset-1.0/root/usr/libexec/gcc/x86_64-redhat-linux/4.7.0/lto-wrapper Target: x86_64-redhat-linux Configured with: …/configure --prefix=/opt/centos/devtoolset-1.0/root/usr --mandir=/opt/centos/devtoolset-1.0/root/usr/share/man --infodir=/opt/centos/devtoolset-1.0/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --enable-languages=c,c++,lto --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --disable-libgcj --with-ppl --with-cloog --with-mpc=/home/centos/rpm/BUILD/gcc-4.7.0-20120507/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) ` Node.js版本:0.12.2 NPM版本:2.7.4 G++版本:4.7.0 OS : Linux xxxx.domain 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
目前与开发机唯一不同在于开发机是32位系统,发布机器是64位系统, 求解。
@DoubleSpout 请问,这模块是你开发的吗?会不会是Linux 2.6内核和3.11内核的问题?
python 版本不对,要用python2.7
好的,明天更新了再试一下。
@DoubleSpout Python更新到了2.7.9, OK, It woks! 没玩过Python,2.6到2.7有这么大的变动?