nodejs / nodejs/nodejs-dist-indexer

`Unexpected token : in JSON at position 3` for rc builds

Open
#24 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
23
Forks
16
Avg merge
3d 3h
Merged PRs (30d)
3

Description

As part of https://github.com/nodejs/build/issues/3524 I've manually run the promotion script on the non-release builds, and I've noticed lots of errors like the following for the rc builds:

SyntaxError: Unexpected token : in JSON at position 3
    at JSON.parse (<anonymous>)
    at /usr/lib/node_modules/nodejs-dist-indexer/dist-indexer.js:119:19
    at BufferListStream._callback (/usr/lib/node_modules/nodejs-dist-indexer/dist-indexer.js:101:5)
    at BufferListStream.end (/usr/lib/node_modules/nodejs-dist-indexer/node_modules/bl/bl.js:65:10)
    at DestroyableTransform.onend (/usr/lib/node_modules/nodejs-dist-indexer/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at Object.onceWrapper (node:events:627:28)
    at DestroyableTransform.emit (node:events:525:35)
    at /usr/lib/node_modules/nodejs-dist-indexer/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:965:16
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
(ignoring error fetching npm version for node/v0.10.44-rc.1)

My guess would be that e.g. v0.10.44-rc.1 isn't mapping to a valid git reference when the substitution is done for https://github.com/nodejs/nodejs-dist-indexer/blob/860a8b4c20ebfa79bef3113527fc963cec61c60f/dist-indexer.js#L20-L22 to fetch the package.json file for npm.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dist-indexer.js at lines 20-22, then trace the JSON.parse call at line 119 and reproduce the promotion script against an rc build such as v0.10.44-rc.1. Done means rc builds no longer produce the JSON parse error and their npm versions are indexed successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.