Skip to content
This repository was archived by the owner on Aug 15, 2018. It is now read-only.

开启同步后经常报错 #1185

Closed
zjgnlzq opened this issue Jan 29, 2015 · 6 comments
Closed

开启同步后经常报错 #1185

zjgnlzq opened this issue Jan 29, 2015 · 6 comments

Comments

@zjgnlzq
Copy link

zjgnlzq commented Jan 29, 2015

用node app.js运行,报错频率非常高,如下是报错内容:

SyntaxError: Unexpected token <
  at Object.parse (native)
  at Request._callback (path(spm.io)\sync\remote.js:65:20)
  at Request.self.callback (path(spm.io)\node_modules\request\request.js:373:22)
  at Request.emit (events.js:98:17)
  at Request.<anonymous> (path(spm.io)\node_modules\request\request.js:1318:14)
  at Request.emit (events.js:117:20)
  at IncomingMessage.<anonymous> (path(spm.io)\node_modules\request\request.js:1266:12)
  at IncomingMessage.emit (events.js:117:20)
  at _stream_readable.js:944:16
  at process._tickCallback (node.js:442:13)
@sorrycc
Copy link
Member

sorrycc commented Jan 29, 2015

网络异常? 是同步哪个包出错?

@zjgnlzq
Copy link
Author

zjgnlzq commented Jan 29, 2015

##有多个包解析会报错,我把日志都放上来

[2015-01-29 15:57:25] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:67] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:67] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:23] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:23] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:75] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:76] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:26] [sync]   sync index.json for package
[2015-01-29 15:57:26] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:75] [sync] dom-support
[2015-01-29 15:57:75] [sync]   getting package info
[2015-01-29 15:57:16] [sync]   start sync
[2015-01-29 15:57:16] [sync]   unpublished versions:
[2015-01-29 15:57:16] [sync]   miss versions: 0.0.2
[2015-01-29 15:57:16] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:40] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:82] [sync]   sync index.json for package
[2015-01-29 15:57:27] [sync] domain
[2015-01-29 15:57:27] [sync]   getting package info
[2015-01-29 15:57:20] [sync]   start sync
[2015-01-29 15:57:20] [sync]   unpublished versions:
[2015-01-29 15:57:20] [sync]   miss versions: 0.0.0
[2015-01-29 15:57:20] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:95] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:18] [sync]   sync index.json for package
[2015-01-29 15:57:61] [sync] domify
[2015-01-29 15:57:61] [sync]   getting package info
[2015-01-29 15:57:11] [sync]   start sync
[2015-01-29 15:57:11] [sync]   unpublished versions:
[2015-01-29 15:57:11] [sync]   miss versions: 1.2.2
[2015-01-29 15:57:11] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:27] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:74] [sync]   sync index.json for package
[2015-01-29 15:57:16] [sync] domready
[2015-01-29 15:57:16] [sync]   getting package info
[2015-01-29 15:57:58] [sync]   start sync
[2015-01-29 15:57:58] [sync]   unpublished versions:
[2015-01-29 15:57:58] [sync]   miss versions: 0.0.1
[2015-01-29 15:57:58] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:06] [sync]   sync index.json for package
[2015-01-29 15:57:06] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:58] [sync] dot
[2015-01-29 15:57:58] [sync]   getting package info
[2015-01-29 15:57:02] [sync]   start sync
[2015-01-29 15:57:02] [sync]   unpublished versions:
[2015-01-29 15:57:02] [sync]   miss versions: 1.0.1
[2015-01-29 15:57:02] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:56] [sync]   sync index.json for package
[2015-01-29 15:57:57] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:00] [sync] dropzone
[2015-01-29 15:57:00] [sync]   getting package info
[2015-01-29 15:57:39] [sync]   start sync
[2015-01-29 15:57:39] [sync]   unpublished versions:
[2015-01-29 15:57:39] [sync]   miss versions: 3.8.7,3.10.2
[2015-01-29 15:57:39] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:80] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:13] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:54] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:81] [sync]   sync index.json for package
[2015-01-29 15:57:73] [sync] dropzone2
[2015-01-29 15:57:74] [sync]   getting package info
[2015-01-29 15:57:41] [sync]   start sync
[2015-01-29 15:57:41] [sync]   unpublished versions:
[2015-01-29 15:57:41] [sync]   miss versions: 3.10.3
[2015-01-29 15:57:41] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:18] [sync]   sync index.json for package
[2015-01-29 15:57:18] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:59] [sync] duratiform
[2015-01-29 15:57:59] [sync]   getting package info
[2015-01-29 15:57:99] [sync]   start sync
[2015-01-29 15:57:99] [sync]   unpublished versions:
[2015-01-29 15:57:99] [sync]   miss versions: 0.1.0
[2015-01-29 15:57:99] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:39] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:83] [sync]   sync index.json for package
[2015-01-29 15:57:45] [sync] each
[2015-01-29 15:57:45] [sync]   getting package info
[2015-01-29 15:57:89] [sync]   start sync
[2015-01-29 15:57:89] [sync]   unpublished versions:
[2015-01-29 15:57:89] [sync]   miss versions: 0.2.2
[2015-01-29 15:57:89] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:06] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:74] [sync]   sync index.json for package
[2015-01-29 15:57:17] [sync] easing
[2015-01-29 15:57:17] [sync]   getting package info
[2015-01-29 15:57:65] [sync]   start sync
[2015-01-29 15:57:65] [sync]   unpublished versions:
[2015-01-29 15:57:65] [sync]   miss versions: 1.3.0
[2015-01-29 15:57:65] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:07] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:41] [sync]   sync index.json for package
[2015-01-29 15:57:14] [sync] easy-pagination
[2015-01-29 15:57:14] [sync]   getting package info
[2015-01-29 15:57:59] [sync]   start sync
[2015-01-29 15:57:59] [sync]   unpublished versions:
[2015-01-29 15:57:59] [sync]   miss versions: 1.0.0
[2015-01-29 15:57:59] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:19] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:39] [sync]   sync index.json for package
[2015-01-29 15:57:81] [sync] easy-pagination2
[2015-01-29 15:57:81] [sync]   getting package info
[2015-01-29 15:57:22] [sync]   start sync
[2015-01-29 15:57:22] [sync]   unpublished versions:
[2015-01-29 15:57:22] [sync]   miss versions: 1.0.0,1.0.1,1.0.2
[2015-01-29 15:57:22] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:10] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:11] [sync]   sync tarball error: [email protected]
[2015-01-29 15:57:94] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:57:95] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:66] [sync]   sync index.json for package
[2015-01-29 15:58:67] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:09] [sync] echo
[2015-01-29 15:58:09] [sync]   getting package info
[2015-01-29 15:58:50] [sync]   start sync
[2015-01-29 15:58:50] [sync]   unpublished versions:
[2015-01-29 15:58:50] [sync]   miss versions: 1.0.0,1.1.0,1.1.1
[2015-01-29 15:58:50] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:69] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:28] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:46] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:11] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:55] [sync]   sync index.json for package
[2015-01-29 15:58:56] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:07] [sync] echo.js
[2015-01-29 15:58:07] [sync]   getting package info
[2015-01-29 15:58:50] [sync]   start sync
[2015-01-29 15:58:50] [sync]   unpublished versions:
[2015-01-29 15:58:50] [sync]   miss versions: 1.6.0
[2015-01-29 15:58:50] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:95] [sync]   sync index.json for package
[2015-01-29 15:58:95] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:43] [sync] edu-mobile
[2015-01-29 15:58:43] [sync]   getting package info
[2015-01-29 15:58:92] [sync]   start sync
[2015-01-29 15:58:92] [sync]   unpublished versions:
[2015-01-29 15:58:92] [sync]   miss versions: 0.0.1
[2015-01-29 15:58:92] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:35] [sync]   sync index.json for package
[2015-01-29 15:58:35] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:58] [sync] emitter
[2015-01-29 15:58:58] [sync]   getting package info
[2015-01-29 15:58:92] [sync]   start sync
[2015-01-29 15:58:92] [sync]   unpublished versions:
[2015-01-29 15:58:92] [sync]   miss versions: 1.1.2
[2015-01-29 15:58:92] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:57] [sync]   sync index.json for package
[2015-01-29 15:58:57] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:14] [sync] emoji
[2015-01-29 15:58:14] [sync]   getting package info
[2015-01-29 15:58:62] [sync]   start sync
[2015-01-29 15:58:62] [sync]   unpublished versions:
[2015-01-29 15:58:62] [sync]   miss versions: 0.3.2
[2015-01-29 15:58:62] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:61] [sync]   sync index.json for package
[2015-01-29 15:58:62] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:18] [sync] es5-shim
[2015-01-29 15:58:18] [sync]   getting package info
[2015-01-29 15:58:92] [sync]   start sync
[2015-01-29 15:58:92] [sync]   unpublished versions:
[2015-01-29 15:58:92] [sync]   miss versions: 4.0.5
[2015-01-29 15:58:92] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:69] [sync]   sync index.json for package
[2015-01-29 15:58:77] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:23] [sync] es6-promise
[2015-01-29 15:58:23] [sync]   getting package info
[2015-01-29 15:58:74] [sync]   start sync
[2015-01-29 15:58:74] [sync]   unpublished versions:
[2015-01-29 15:58:74] [sync]   miss versions: 2.0.1
[2015-01-29 15:58:74] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:91] [sync]   sync index.json for package
[2015-01-29 15:58:91] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:38] [sync] espresso.js
[2015-01-29 15:58:38] [sync]   getting package info
[2015-01-29 15:58:90] [sync]   start sync
[2015-01-29 15:58:90] [sync]   unpublished versions:
[2015-01-29 15:58:90] [sync]   miss versions: 0.0.1
[2015-01-29 15:58:90] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:43] [sync]   sync index.json for package
[2015-01-29 15:58:43] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:96] [sync] eva
[2015-01-29 15:58:96] [sync]   getting package info
[2015-01-29 15:58:52] [sync]   start sync
[2015-01-29 15:58:52] [sync]   unpublished versions:
[2015-01-29 15:58:52] [sync]   miss versions: 0.1.0,0.1.1,0.1.2,0.1.3
[2015-01-29 15:58:52] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:03] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:03] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:23] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:23] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:83] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:83] [sync]   sync tarball error: [email protected]
cacheIndex
[2015-01-29 15:58:59] [sync]   sync index.json for package
[2015-01-29 15:58:59] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:41] [sync] eve
[2015-01-29 15:58:41] [sync]   getting package info
[2015-01-29 15:58:30] [sync]   start sync
[2015-01-29 15:58:30] [sync]   unpublished versions:
[2015-01-29 15:58:30] [sync]   miss versions: 0.5.0
[2015-01-29 15:58:30] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:58:41] [sync]   sync index.json for package
[2015-01-29 15:58:41] [sync]   sync tarball error: [email protected]
[2015-01-29 15:58:79] [sync] event
[2015-01-29 15:58:79] [sync]   getting package info
[2015-01-29 15:58:09] [sync]   start sync
[2015-01-29 15:58:09] [sync]   unpublished versions:
[2015-01-29 15:58:09] [sync]   miss versions: 0.1.3,0.1.1
[2015-01-29 15:58:09] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:06] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:06] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:20] [sync]   sync index.json for package
[2015-01-29 15:59:20] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:62] [sync] event-simulate
[2015-01-29 15:59:62] [sync]   getting package info
[2015-01-29 15:59:76] [sync]   start sync
[2015-01-29 15:59:76] [sync]   unpublished versions:
[2015-01-29 15:59:76] [sync]   miss versions: 1.0.0,0.5.0
[2015-01-29 15:59:76] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:95] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:21] [sync]   sync tarball and index.json for [email protected]
cacheIndex
[2015-01-29 15:59:36] [sync]   sync index.json for package
[2015-01-29 15:59:37] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:18] [sync] eventie
[2015-01-29 15:59:19] [sync]   getting package info
[2015-01-29 15:59:56] [sync]   start sync
[2015-01-29 15:59:56] [sync]   unpublished versions:
[2015-01-29 15:59:56] [sync]   miss versions: 1.0.5
[2015-01-29 15:59:56] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:12] [sync]   sync index.json for package
[2015-01-29 15:59:12] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:57] [sync] eventor
[2015-01-29 15:59:57] [sync]   getting package info
[2015-01-29 15:59:03] [sync]   start sync
[2015-01-29 15:59:03] [sync]   unpublished versions:
[2015-01-29 15:59:03] [sync]   miss versions: 0.0.1
[2015-01-29 15:59:03] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:28] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:89] [sync]   sync index.json for package
[2015-01-29 15:59:38] [sync] eventproxy
[2015-01-29 15:59:38] [sync]   getting package info
[2015-01-29 15:59:84] [sync]   start sync
[2015-01-29 15:59:84] [sync]   unpublished versions:
[2015-01-29 15:59:84] [sync]   miss versions: 0.3.2
[2015-01-29 15:59:84] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:35] [sync]   sync index.json for package
[2015-01-29 15:59:36] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:78] [sync] events
[2015-01-29 15:59:78] [sync]   getting package info
[2015-01-29 15:59:17] [sync]   start sync
[2015-01-29 15:59:17] [sync]   unpublished versions:
[2015-01-29 15:59:17] [sync]   miss versions: 1.0.1
[2015-01-29 15:59:17] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:30] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:80] [sync]   sync index.json for package
[2015-01-29 15:59:15] [sync] evt
[2015-01-29 15:59:15] [sync]   getting package info
[2015-01-29 15:59:51] [sync]   start sync
[2015-01-29 15:59:51] [sync]   unpublished versions:
[2015-01-29 15:59:51] [sync]   miss versions: 0.1.0,0.2.0,0.2.1,0.2.2
[2015-01-29 15:59:51] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:88] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:88] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:40] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:40] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:94] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:95] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:23] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:80] [sync]   sync index.json for package
[2015-01-29 15:59:17] [sync] example
[2015-01-29 15:59:17] [sync]   getting package info
[2015-01-29 15:59:56] [sync]   start sync
[2015-01-29 15:59:56] [sync]   unpublished versions:
[2015-01-29 15:59:56] [sync]   miss versions: 1.0.0
[2015-01-29 15:59:56] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:97] [sync]   sync index.json for package
[2015-01-29 15:59:97] [sync]   sync tarball error: [email protected]
[2015-01-29 15:59:37] [sync] expect
[2015-01-29 15:59:37] [sync]   getting package info
[2015-01-29 15:59:75] [sync]   start sync
[2015-01-29 15:59:75] [sync]   unpublished versions:
[2015-01-29 15:59:75] [sync]   miss versions: 0.3.1
[2015-01-29 15:59:75] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 15:59:16] [sync]   sync index.json for package
[2015-01-29 15:59:17] [sync]   sync tarball error: [email protected]

SyntaxError: Unexpected token <

sorrycc added a commit to spmjs/spmjs.io that referenced this issue Jan 29, 2015
@sorrycc
Copy link
Member

sorrycc commented Jan 29, 2015

sync tarball error 是误报,已修复。

SyntaxError: Unexpected token < 这个重现不了。能定位到是哪个包同步出错吗? 再用 node scripts/sync.js pkg 手动同步下看还是否会报错。

@zjgnlzq
Copy link
Author

zjgnlzq commented Jan 29, 2015

每次报错遇到的包都不一样,我测了两次
##第一次

[2015-01-29 17:47:59] [sync] anima-base64utf8
[2015-01-29 17:47:59] [sync]   getting package info
[2015-01-29 17:47:97] [sync]   start sync
[2015-01-29 17:47:97] [sync]   unpublished versions:
[2015-01-29 17:47:97] [sync]   miss versions: 1.0.0
[2015-01-29 17:47:97] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 17:47:35] [sync]   sync index.json for package

SyntaxError: Unexpected token <
  at Object.parse (native)
  at Request._callback (D:\spmjs.io\sync\remote.js:65:20)
  at Request.self.callback (D:\spmjs.io\node_modules\request\request.js:373:22)
  at Request.emit (events.js:98:17)
  at Request.<anonymous> (D:\spmjs.io\node_modules\request\request.js:1318:14)
  at Request.emit (events.js:117:20)
  at IncomingMessage.<anonymous> (D:\spmjs.io\node_modules\request\request.js:1266:12)
  at IncomingMessage.emit (events.js:117:20)
  at _stream_readable.js:944:16
  at process._tickCallback (node.js:442:13)


D:\spmjs.io>node scripts/sync.js anima-base64utf8
[2015-01-29 17:51:83] [sync] start sync: anima-base64utf8
[2015-01-29 17:51:83] [sync] anima-base64utf8
[2015-01-29 17:51:83] [sync]   getting package info
[2015-01-29 17:51:21] [sync]   start sync
[2015-01-29 17:51:21] [sync]   unpublished versions:
[2015-01-29 17:51:21] [sync]   miss versions: 1.0.0
[2015-01-29 17:51:21] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 17:51:86] [sync]   sync index.json for package
[2015-01-29 17:51:26] [sync] sync end

###遇到上面的问题,我手动执行

C:\spmjs.io>node scripts/sync.js anima-base64utf8
[2015-01-29 17:51:83] [sync] start sync: anima-base64utf8
[2015-01-29 17:51:83] [sync] anima-base64utf8
[2015-01-29 17:51:83] [sync]   getting package info
[2015-01-29 17:51:21] [sync]   start sync
[2015-01-29 17:51:21] [sync]   unpublished versions:
[2015-01-29 17:51:21] [sync]   miss versions: 1.0.0
[2015-01-29 17:51:21] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 17:51:86] [sync]   sync index.json for package
[2015-01-29 17:51:26] [sync] sync end

###可以安装成功

##第二次,重新启动自动同步,又遇到同样的问题,但是包不一样

[2015-01-29 18:03:64] [sync] bui-common
[2015-01-29 18:03:64] [sync]   getting package info
[2015-01-29 18:03:04] [sync]   start sync
[2015-01-29 18:03:05] [sync]   unpublished versions:
[2015-01-29 18:03:05] [sync]   miss versions: 1.1.0,1.1.1,1.1.2,1.1.3
[2015-01-29 18:03:05] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 18:03:71] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 18:03:53] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 18:03:70] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 18:03:70] [sync]   sync tarball error: [email protected]
[2015-01-29 18:03:87] [sync]   sync index.json for package
[2015-01-29 18:03:87] [sync]   sync tarball error: [email protected]

SyntaxError: Unexpected token <
  at Object.parse (native)
  at Request._callback (C:\spmjs.io\sync\remote.js:65:20)
  at Request.self.callback (C:\spmjs.io\node_modules\request\request.js:373:22)
  at Request.emit (events.js:98:17)
  at Request.<anonymous> (C:\spmjs.io\node_modules\request\request.js:1318:14)
  at Request.emit (events.js:117:20)
  at IncomingMessage.<anonymous> (C:\spmjs.io\node_modules\request\request.js:1266:12)
  at IncomingMessage.emit (events.js:117:20)
  at _stream_readable.js:944:16
  at process._tickCallback (node.js:442:13)

##我是在64位 window7上运行,node版本v0.10.35

@sorrycc
Copy link
Member

sorrycc commented Jan 29, 2015

C:\spmjs.io\sync\remote.js:65

改下这里的代码,把 package 信息打出来看下是啥。

On Thu, Jan 29, 2015 at 6:36 PM, zjgnlzq [email protected] wrote:

每次报错遇到的包都不一样,我测了两次
##第一次

[2015-01-29 17:47:59] [sync] anima-base64utf8
[2015-01-29 17:47:59] [sync] getting package info
[2015-01-29 17:47:97] [sync] start sync
[2015-01-29 17:47:97] [sync] unpublished versions:
[2015-01-29 17:47:97] [sync] miss versions: 1.0.0
[2015-01-29 17:47:97] [sync] sync tarball and index.json for [email protected]
[2015-01-29 17:47:35] [sync] sync index.json for package

SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (D:\spmjs.io\sync\remote.js:65:20)
at Request.self.callback (D:\spmjs.io\node_modules\request\request.js:373:22)
at Request.emit (events.js:98:17)
at Request. (D:\spmjs.io\node_modules\request\request.js:1318:14)
at Request.emit (events.js:117:20)
at IncomingMessage. (D:\spmjs.io\node_modules\request\request.js:1266:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:442:13)

D:\spmjs.io>node scripts/sync.js anima-base64utf8
[2015-01-29 17:51:83] [sync] start sync: anima-base64utf8
[2015-01-29 17:51:83] [sync] anima-base64utf8
[2015-01-29 17:51:83] [sync] getting package info
[2015-01-29 17:51:21] [sync] start sync
[2015-01-29 17:51:21] [sync] unpublished versions:
[2015-01-29 17:51:21] [sync] miss versions: 1.0.0
[2015-01-29 17:51:21] [sync] sync tarball and index.json for [email protected]
[2015-01-29 17:51:86] [sync] sync index.json for package
[2015-01-29 17:51:26] [sync] sync end

###遇到上面的问题,我手动执行

C:\spmjs.io>node scripts/sync.js anima-base64utf8
[2015-01-29 17:51:83] [sync] start sync: anima-base64utf8
[2015-01-29 17:51:83] [sync] anima-base64utf8
[2015-01-29 17:51:83] [sync] getting package info
[2015-01-29 17:51:21] [sync] start sync
[2015-01-29 17:51:21] [sync] unpublished versions:
[2015-01-29 17:51:21] [sync] miss versions: 1.0.0
[2015-01-29 17:51:21] [sync] sync tarball and index.json for [email protected]
[2015-01-29 17:51:86] [sync] sync index.json for package
[2015-01-29 17:51:26] [sync] sync end

###可以安装成功

##第二次,重新启动自动同步,又遇到同样的问题,但是包不一样

[2015-01-29 18:03:64] [sync] bui-common
[2015-01-29 18:03:64] [sync] getting package info
[2015-01-29 18:03:04] [sync] start sync
[2015-01-29 18:03:05] [sync] unpublished versions:
[2015-01-29 18:03:05] [sync] miss versions: 1.1.0,1.1.1,1.1.2,1.1.3
[2015-01-29 18:03:05] [sync] sync tarball and index.json for [email protected]
[2015-01-29 18:03:71] [sync] sync tarball and index.json for [email protected]
[2015-01-29 18:03:53] [sync] sync tarball and index.json for [email protected]
[2015-01-29 18:03:70] [sync] sync tarball and index.json for [email protected]
[2015-01-29 18:03:70] [sync] sync tarball error: [email protected]
[2015-01-29 18:03:87] [sync] sync index.json for package
[2015-01-29 18:03:87] [sync] sync tarball error: [email protected]

SyntaxError: Unexpected token <
at Object.parse (native)
at Request._callback (C:\spmjs.io\sync\remote.js:65:20)
at Request.self.callback (C:\spmjs.io\node_modules\request\request.js:373:22)
at Request.emit (events.js:98:17)
at Request. (C:\spmjs.io\node_modules\request\request.js:1318:14)
at Request.emit (events.js:117:20)
at IncomingMessage. (C:\spmjs.io\node_modules\request\request.js:1266:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:442:13)

##我是在64位 window7上运行,node版本v0.10.35


Reply to this email directly or view it on GitHub
#1185 (comment).

@zjgnlzq
Copy link
Author

zjgnlzq commented Jan 29, 2015

[2015-01-29 19:04:84] [sync] bui-overlay
[2015-01-29 19:04:84] [sync]   getting package info
[2015-01-29 19:04:35] [sync]   start sync
[2015-01-29 19:04:35] [sync]   unpublished versions:
[2015-01-29 19:04:35] [sync]   miss versions: 1.1.0,1.1.1,1.1.2,1.1.3,1.1.4
[2015-01-29 19:04:35] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 19:04:17] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 19:04:63] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 19:04:38] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 19:04:57] [sync]   sync tarball error: [email protected]
[2015-01-29 19:04:58] [sync]   sync tarball and index.json for [email protected]
[2015-01-29 19:04:77] [sync]   sync tarball error: [email protected]
[2015-01-29 19:04:78] [sync]   sync index.json for package
=========>这里是这条语句(var pkg = JSON.parse(body);)参数body的内容
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<h1>502 Bad Gateway</h1>
<p>The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.<br/>
Please report this message and include the following information to us.<br/>
Thank you very much!</p>
<table>
<tr>
<td>URL:</td>
<td>http://spmjs.io/repository/bui-overlay</td>
</tr>
<tr>
<td>Server:</td>
<td>localhost.localdomain</td>
</tr>
<tr>
<td>Date:</td>
<td>2015/01/29 11:04:53</td>
</tr>
</table>
<hr/>Powered by Tengine/2.0.3</body>
</html>

--------------

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants