Problem
onnxruntime-node (currently resolved to 1.27.0 via the ^1.15.0 range in
package.json) runs a postinstall script (node ./script/install) that, on
linux/x64, unconditionally attempts to download the CUDA/TensorRT execution
provider binaries (libonnxruntime_providers_cuda.so,
libonnxruntime_providers_tensorrt.so, libonnxruntime_providers_shared.so)
from a NuGet feed at `(api.nuget.org/redacted) — unless the
installer is explicitly told to skip.
This is driven by script/install-metadata.js in the installed package, which
hardcodes:
requirements: {
'linux/x64': ['cuda12'],
...
}
script/install.js only skips this download if ONNXRUNTIME_NODE_INSTALL (or
the npm config equivalent) is explicitly set to skip — there is no such
opt-out configured anywhere in this repo (no .npmrc, no env var). If the
NuGet feed is unreachable — any network-restricted CI runner, corporate proxy,
sandboxed/offline environment, or Docker build with locked-down egress — the
download throws and npm ci/npm install fails outright with:
npm error Error: getaddrinfo EAI_AGAIN api.nuget.org
npm error path .../node_modules/onnxruntime-node
npm error command sh -c node ./script/install
Reproduced on a clean checkout: npm ci fails with the error above. Setting
ONNXRUNTIME_NODE_INSTALL=skip npm ci succeeds cleanly (385 packages
installed, 0 vulnerabilities), and with that skip in place npm run typecheck, npm test (23/23 passing), npm run lint, and npm run format:check all pass without issue — confirming the project only needs the
bundled CPU execution provider. Nothing in src/ configures or uses a CUDA
execution provider; src/embeddings.ts runs @huggingface/transformers with
the default (CPU) backend.
This doesn't currently break this repo's own CI (ubuntu-latest
GitHub-hosted runners have unrestricted internet access to nuget.org), but it
makes npm install fragile for anyone following the README's npm install
step from a network-restricted environment — exactly the kind of place a
"just clone and run this example" tutorial gets used (corporate networks,
egress-locked CI, offline dev containers).
Acceptance criteria
- Adding an
.npmrc entry (or equivalent) that sets the package-specific
onnxruntime-node:onnxruntime_node_install=skip config so a clean
npm ci/npm install no longer attempts to contact api.nuget.org.
npm ci succeeds on a clean checkout with no other environment variables
set.
npm run typecheck, npm test, npm run lint, and npm run format:check
all still pass after the change (they exercise only the CPU embedding path,
so behavior should be unaffected).
Scope
Only the onnxruntime-node postinstall CUDA-download behavior is in scope —
add the minimal config needed to opt out of the unused GPU binary fetch.
Do not touch unrelated dependency versions, CI workflow content, or any other
package's install behavior; those are tracked separately.
Generated by GitHub Maintenance Audit · sonnet50 · 104 AIC · ⌖ 5.93 AIC · ⊞ 7.9K · ◷
Problem
onnxruntime-node(currently resolved to1.27.0via the^1.15.0range inpackage.json) runs apostinstallscript (node ./script/install) that, onlinux/x64, unconditionally attempts to download the CUDA/TensorRT executionprovider binaries (
libonnxruntime_providers_cuda.so,libonnxruntime_providers_tensorrt.so,libonnxruntime_providers_shared.so)from a NuGet feed at `(api.nuget.org/redacted) — unless the
installer is explicitly told to skip.
This is driven by
script/install-metadata.jsin the installed package, whichhardcodes:
script/install.jsonly skips this download ifONNXRUNTIME_NODE_INSTALL(orthe npm config equivalent) is explicitly set to
skip— there is no suchopt-out configured anywhere in this repo (no
.npmrc, no env var). If theNuGet feed is unreachable — any network-restricted CI runner, corporate proxy,
sandboxed/offline environment, or Docker build with locked-down egress — the
download throws and
npm ci/npm installfails outright with:Reproduced on a clean checkout:
npm cifails with the error above. SettingONNXRUNTIME_NODE_INSTALL=skip npm cisucceeds cleanly (385 packagesinstalled, 0 vulnerabilities), and with that skip in place
npm run typecheck,npm test(23/23 passing),npm run lint, andnpm run format:checkall pass without issue — confirming the project only needs thebundled CPU execution provider. Nothing in
src/configures or uses a CUDAexecution provider;
src/embeddings.tsruns@huggingface/transformerswiththe default (CPU) backend.
This doesn't currently break this repo's own CI (
ubuntu-latestGitHub-hosted runners have unrestricted internet access to nuget.org), but it
makes
npm installfragile for anyone following the README'snpm installstep from a network-restricted environment — exactly the kind of place a
"just clone and run this example" tutorial gets used (corporate networks,
egress-locked CI, offline dev containers).
Acceptance criteria
.npmrcentry (or equivalent) that sets the package-specificonnxruntime-node:onnxruntime_node_install=skipconfig so a cleannpm ci/npm installno longer attempts to contactapi.nuget.org.npm cisucceeds on a clean checkout with no other environment variablesset.
npm run typecheck,npm test,npm run lint, andnpm run format:checkall still pass after the change (they exercise only the CPU embedding path,
so behavior should be unaffected).
Scope
Only the
onnxruntime-nodepostinstall CUDA-download behavior is in scope —add the minimal config needed to opt out of the unused GPU binary fetch.
Do not touch unrelated dependency versions, CI workflow content, or any other
package's install behavior; those are tracked separately.