Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node 9 support #1290

Closed
yzgyyang opened this issue Nov 29, 2017 · 5 comments
Closed

Node 9 support #1290

yzgyyang opened this issue Nov 29, 2017 · 5 comments
Labels
core Server, BaseService, GitHub auth, Shared helpers

Comments

@yzgyyang
Copy link

yzgyyang commented Nov 29, 2017

I encountered an error when loading http://[::]:8080/ after starting the server using npm start.

➜  shields (master) ✔ npm start

> [email protected] start /Users/USERNAME/shields
> node server 8080 ::

No secret data found at /Users/USERNAME/shields/private/secret.json (see lib/server-secrets.js)
1129020506 Server is starting up: http://[::]:8080/
/Users/USERNAME/shields/node_modules/camp/lib/camp.js:239
    jsonFromQuery(req.uri.search.slice(1), req.query);
                                 ^

TypeError: Cannot read property 'slice' of null
    at getQueries (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:239:34)
    at catchpath (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:902:3)
    at Array.routeLayer (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:864:7)
    at bubble (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:406:26)
    at next (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:407:46)
    at Array.pathLayer (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:837:16)
    at bubble (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:406:26)
    at next (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:407:46)
    at Array.eventSourceLayer (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:616:49)
    at bubble (/Users/USERNAME/shields/node_modules/camp/lib/camp.js:406:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server 8080 ::`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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!     /Users/USERNAME/.npm/_logs/2017-11-29T02_05_06_309Z-debug.log

And the error log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/8.9.1/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/activision/shields/node_modules/.bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle [email protected]~start: CWD: /Users/activision/shields
10 silly lifecycle [email protected]~start: Args: [ '-c', 'node server 8080 ::' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node server 8080 ::`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at EventEmitter.emit (events.js:159:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:159:13)
13 verbose stack     at maybeClose (internal/child_process.js:943:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/activision/shields
16 verbose Darwin 17.2.0
17 verbose argv "/usr/local/Cellar/node/8.9.1/bin/node" "/usr/local/bin/npm" "start"
18 verbose node v9.2.0
19 verbose npm  v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `node server 8080 ::`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I am not sure if it's a real problem or it is just me having incorrect installations of node & npm.

@yzgyyang
Copy link
Author

yzgyyang commented Nov 29, 2017

I encountered the same error on my Ubuntu machine as well. Should I try older versions of nodejs?

@paulmelnikow
Copy link
Member

Thanks for the report. This is a Node 9 issue in scoutcamp, the web framework created by a shields long-time maintainer, and it's been reported there: espadrine/sc#65.

I can reproduce it in unit tests:

  1) The server
       should produce colorscheme badges:
     Uncaught TypeError: Cannot read property 'slice' of null
      at getQueries (node_modules/camp/lib/camp.js:239:34)
      at catchpath (node_modules/camp/lib/camp.js:902:3)
      at Array.routeLayer (node_modules/camp/lib/camp.js:864:7)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at next (node_modules/camp/lib/camp.js:407:46)
      at Array.pathLayer (node_modules/camp/lib/camp.js:837:16)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at next (node_modules/camp/lib/camp.js:407:46)
      at Array.eventSourceLayer (node_modules/camp/lib/camp.js:616:49)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at next (node_modules/camp/lib/camp.js:407:46)
      at Array.ajaxLayer (node_modules/camp/lib/camp.js:516:39)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at next (node_modules/camp/lib/camp.js:407:46)
      at Array.wsLayer (node_modules/camp/lib/camp.js:505:50)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at next (node_modules/camp/lib/camp.js:407:46)
      at Array.genericLayer (node_modules/camp/lib/camp.js:443:5)
      at bubble (node_modules/camp/lib/camp.js:406:26)
      at listener (node_modules/camp/lib/camp.js:400:3)
      at Camp.<anonymous> (node_modules/camp/lib/camp.js:363:45)
      at parserOnIncoming (_http_server.js:619:12)
      at HTTPParser.parserOnHeadersComplete (_http_common.js:117:23)

If you feel like looking into it, that'd be helpful! I'd be happy to add Node 9 to our Travis suite once it's working.

@paulmelnikow paulmelnikow added bug Bugs in badges and the frontend core Server, BaseService, GitHub auth, Shared helpers labels Nov 29, 2017
@paulmelnikow paulmelnikow changed the title ERR! code ELIFECYCLE when loading the site after npm start Node 9 support Nov 29, 2017
@paulmelnikow paulmelnikow removed the bug Bugs in badges and the frontend label Nov 29, 2017
@paulmelnikow
Copy link
Member

After #1291 postinstall will fail under Node 9, printing a more helpful error message.

@yzgyyang
Copy link
Author

Thanks for the reply and quick commit to block node 9 for now! I would very much like to help to solve this, but since I am not really a nodejs developer, I will just start from rolling back to nodejs 8 and adding some badges to the project (which is why I encountered this at the first place). Please keep me updated!

@paulmelnikow
Copy link
Member

Fixed in #1543!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Server, BaseService, GitHub auth, Shared helpers
Projects
None yet
Development

No branches or pull requests

2 participants