Skip to content

Unexpected token : in JSON at position 3 for rc builds #24

Description

@richardlau

As part of nodejs/build#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

// needs auth: githubContentUrl = 'https://api.github.com/repos/nodejs/node/contents'
const githubContentUrl = 'https://raw.githubusercontent.com/nodejs/{repo}/{gitref}'
const npmPkgJsonUrl = `${githubContentUrl}/deps/npm/package.json`
to fetch the package.json file for npm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions