Skip to content

fix(ci): make npm package tests compatible with Node.js 12#618

Merged
joaoopereira merged 3 commits intodevelopment-add-support-for-fallback-repositoriesfrom
copilot/sub-pr-614
Dec 3, 2025
Merged

fix(ci): make npm package tests compatible with Node.js 12#618
joaoopereira merged 3 commits intodevelopment-add-support-for-fallback-repositoriesfrom
copilot/sub-pr-614

Conversation

Copy link
Contributor

Copilot AI commented Nov 28, 2025

CI build failing because Jest 29.7.0 and other dependencies require Node.js 14+ but workflow used Node.js 12.

Changes

  • Downgraded Jest from 29.7.0 to 27.5.1 (last version supporting Node.js 12)
  • Downgraded axios from 1.7.9 to 0.27.2 (last version with CommonJS exports)
  • Downgraded http-proxy-agent from 7.0.2 to 5.0.0 (last version supporting Node.js 12)
  • Downgraded https-proxy-agent from 7.0.5 to 5.0.1 (last version supporting Node.js 12)
  • Updated proxy agent API usage in postinstall.js and tests to use the v5.x API (direct exports instead of named exports)
  • Updated actions/setup-node from v2 to v4 for security

Root Cause

Jest 29.7.0 uses optional chaining (?.) which isn't supported in Node.js 12:

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)

Additionally, axios 1.x uses ESM-only exports and proxy-agent v6+ requires Node.js 14+.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…ompatibility

Co-authored-by: joaoopereira <3718704+joaoopereira@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 1javsblobprodcus364.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 37bvsblobprodcus311.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 37cvsblobprodcus359.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 4m6vsblobprodcus384.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 4zjvsblobprodcus390.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 6s7vsblobprodcus313.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • 7tjvsblobprodcus341.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • bcnvsblobprodcus378.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • c78vsblobprodcus322.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • cflvsblobprodcus383.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • ckzvsblobprodcus347.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • h6tvsblobprodcus346.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • jd4vsblobprodcus366.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • kijvsblobprodcus387.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • kmuvsblobprodcus389.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • kxqvsblobprodcus376.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • ljcvsblobprodcus317.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • lylvsblobprodcus31.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • rcxvsblobprodcus328.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • s8mvsblobprodcus38.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • sc4vsblobprodcus331.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • sqdvsblobprodcus333.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • st8vsblobprodcus339.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • tphvsblobprodcus375.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)
  • vwvvsblobprodcus334.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet restore (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add support for fallback repositories fix(ci): update Node.js to 18 for Jest compatibility Nov 28, 2025
Copilot AI requested a review from joaoopereira November 28, 2025 11:14
@joaoopereira
Copy link
Member

@copilot can you make it compatible with node 12 instead of changing the node version?

- Downgraded Jest from v29.7.0 to v27.5.1 (supports Node.js 12)
- Downgraded axios from v1.7.9 to v0.27.2 (uses CommonJS, not ESM)
- Downgraded http-proxy-agent from v7.0.2 to v5.0.0 (supports Node.js 12)
- Downgraded https-proxy-agent from v7.0.5 to v5.0.1 (supports Node.js 12)
- Updated proxy agent usage to use the v5.x API

Co-authored-by: joaoopereira <3718704+joaoopereira@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot can you make it compatible with node 12 instead of changing the node version?

Fixed in 9526b26. Changed the dependencies to versions compatible with Node.js 12:

  • Jest: 29.7.027.5.1
  • axios: 1.7.90.27.2 (last version with CommonJS exports)
  • http-proxy-agent: 7.0.25.0.0
  • https-proxy-agent: 7.0.55.0.1

Also updated the proxy agent API usage in postinstall.js and tests to use the v5.x API (direct exports instead of named exports).

Copilot AI changed the title fix(ci): update Node.js to 18 for Jest compatibility fix(ci): make npm package tests compatible with Node.js 12 Nov 28, 2025
@joaoopereira joaoopereira marked this pull request as ready for review December 3, 2025 00:30
@joaoopereira joaoopereira merged commit 2a5b2e5 into development-add-support-for-fallback-repositories Dec 3, 2025
@joaoopereira joaoopereira deleted the copilot/sub-pr-614 branch December 3, 2025 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants