lqqyt2423/wechat_spider

会出现崩溃错误。。。[底部有截图]

Opened this issue · 3 comments

运行一会儿就会出现这个错误并崩溃退出,安卓、iPhone 都会:

/data/wechat_spider/node_modules/brotli/build/encode.js:3
1<process.argv.length?process.argv[1].replace(/\\/g,"/"):"unknown-program");b.arguments=process.argv.slice(2);"undefined"!==typeof module&&(module.exports=b);process.on("uncaughtException",function(a){if(!(a instanceof y))throw a;});b.inspect=function(){return"[Emscripten Module object]"}}else if(x)b.print||(b.print=print),"undefined"!=typeof printErr&&(b.printErr=printErr),b.read="undefined"!=typeof read?read:function(){throw"no read() available (jsc?)";},b.readBinary=function(a){if("function"===
                                                                                                                                                                                                                              ^

Error: read ECONNRESET
    at TCP.onread (net.js:660:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! wechat_spider@1.1.1 start: `node index.js`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the wechat_spider@1.1.1 start 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!     /root/.npm/_logs/2018-08-30T20_50_21_381Z-debug.log

然后 2018-08-30T20_50_21_381Z-debug.log 里的内容是这样的:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.2.0
3 info using node@v10.9.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle wechat_spider@1.1.1~prestart: wechat_spider@1.1.1
6 info lifecycle wechat_spider@1.1.1~start: wechat_spider@1.1.1
7 verbose lifecycle wechat_spider@1.1.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle wechat_spider@1.1.1~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/data/wechat_spider/node_modules/.bin:/usr/local/jdk/jdk1.8.0_151/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
9 verbose lifecycle wechat_spider@1.1.1~start: CWD: /data/wechat_spider
10 silly lifecycle wechat_spider@1.1.1~start: Args: [ '-c', 'node index.js' ]
11 silly lifecycle wechat_spider@1.1.1~start: Returned: code: 7  signal: null
12 info lifecycle wechat_spider@1.1.1~start: Failed to exec start script
13 verbose stack Error: wechat_spider@1.1.1 start: `node index.js`
13 verbose stack Exit status 7
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:961:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:250:5)
14 verbose pkgid wechat_spider@1.1.1
15 verbose cwd /data/wechat_spider
16 verbose Linux 3.10.0-693.2.2.el7.x86_64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v10.9.0
19 verbose npm  v6.2.0
20 error code ELIFECYCLE
21 error errno 7
22 error wechat_spider@1.1.1 start: `node index.js`
22 error Exit status 7
23 error Failed at the wechat_spider@1.1.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 7, true ]

这是截图:
wx_spider_error

我也会遇到类似的错,不知什么原因。
image

/wechat_spider/node_modules/brotli/build/encode.js
第三行: if(!(a instanceof y)) throw a;
改成: if(!(a instanceof y)) console.log(a);
这样可以避免index.js进程崩溃

@JackTheMico 这位兄弟的解决方法我没有试过
自动崩溃的原因我也不确定
不过你可以用 pm2 崩溃了重启就好了