node v10.8, v10.9 not supported
with `cnpm'
cnpm install ccap
⠙ [0/1] Installing ccap@*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!
✔ Installed 1 packages
✔ Linked 3 latest versions
gyp http GET https://npm.taobao.org/mirrors/node/v10.9.0/node-v10.9.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: socket hang up
gyp ERR! stack at createHangUpError (_http_client.js:322:15)
gyp ERR! stack at Socket.socketOnEnd (_http_client.js:425:23)
gyp ERR! stack at Socket.emit (events.js:187:15)
gyp ERR! stack at endReadableNT (_stream_readable.js:1085:12)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Linux 4.9.0-7-amd64
gyp ERR! command "/home/taoqf/.nvm/versions/node/v10.9.0/bin/node" "/home/taoqf/.nvm/versions/node/v10.9.0/lib/node_modules/cnpm/node_modules/npminstall/node-gyp-bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/taoqf/gitee/feidaokj/self_sell/node_modules/[email protected]@ccap
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
✖ Install fail! Error: post install error, please remove node_modules before retry!
Run "sh -c node-gyp rebuild" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "sh -c node-gyp rebuild" error, exit code 1
at ChildProcess.proc.on.code (/home/taoqf/.nvm/versions/node/v10.9.0/lib/node_modules/cnpm/node_modules/runscript/index.js:74:21)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
npminstall version: 3.11.0
npminstall args: /home/taoqf/.nvm/versions/node/v10.9.0/bin/node /home/taoqf/.nvm/versions/node/v10.9.0/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js --fix-bug-versions --china --userconfig=/home/taoqf/.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=http://172.16.15.24:7001 ccap
Even with npm:
npm install ccap
> [email protected] preinstall /home/taoqf/gitee/feidaokj/self_sell/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!
> [email protected] install /home/taoqf/gitee/feidaokj/self_sell/node_modules/ccap
> node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: socket hang up
gyp ERR! stack at createHangUpError (_http_client.js:322:15)
gyp ERR! stack at Socket.socketOnEnd (_http_client.js:425:23)
gyp ERR! stack at Socket.emit (events.js:187:15)
gyp ERR! stack at endReadableNT (_stream_readable.js:1085:12)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Linux 4.9.0-7-amd64
gyp ERR! command "/home/taoqf/.nvm/versions/node/v10.9.0/bin/node" "/home/taoqf/.nvm/versions/node/v10.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/taoqf/gitee/feidaokj/self_sell/node_modules/ccap
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/taoqf/.npm/_logs/2018-08-22T02_50_27_159Z-debug.log
+1
作者似乎已经不怎么维护这个库了。 但是这个问题好像跟nodejs版本有关,我这里有些电脑就没有这问题。 有些电脑就会有。我怀疑是网络的问题,但是至今得不到很好的验证。
作者似乎已经不怎么维护这个库了。 但是这个问题好像跟nodejs版本有关,我这里有些电脑就没有这问题。 有些电脑就会有。我怀疑是网络的问题,但是至今得不到很好的验证。
我用 node v11.1 编译成功了
@yasuoganliang @taoqf 如果不介意的话,可以使用我修改过的https://github.com/ftfuntjh/ccap 这个的fix版本,其中在v12.3.1编译成功。编译不成功的原因是所有的Local<T> 到 c++原生类型的转换的函数,例如Local<Value>::toString()的函数签名变为Local<Value>::toString(Context) 导致了编译出错。我已经修复。
@ftfuntjh 多谢,我现在改用了一个纯js的库来生成验证码,c++的库目前来说在nodejs升级方面还是不太好用,除非作者维护地非常及时才行。不是效率要求特别高的,不建议使用c++的库,如果效率有要求,就自己用c++实现吧