Skip to content

[Web] onnxruntime-node post-install script errors with: "Failed to find runtimes/win-x64/native/libonnxruntime_providers_cuda.so in NuGet package" #24770

Closed
@rotemdan

Description

@rotemdan

Describe the issue

Running:

npm install onnxruntime-node

on Linux or WSL2 (also reported on Debian 12), where CUDA Toolkit and cuDNN are available, causes the CUDA EP binaries to be downloaded during the post-install script.

After the binaries seem to be downloaded it errors with:

npm verbose pkgid onnxruntime-node@1.22.0
npm error code 1
npm error path /home/x/test111/node_modules/onnxruntime-node
npm error command failed
npm error command sh -c node ./script/install
npm error Downloading https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime.gpu.linux/1.22.0/microsoft.ml.onnxruntime.gpu.linux.1.22.0.nupkg
npm error /home/x/test111/node_modules/onnxruntime-node/script/install-utils.js:176
npm error               throw new Error(`Failed to find ${pathInPackage} in NuGet package`);
npm error                     ^
npm error
npm error Error: Failed to find runtimes/win-x64/native/libonnxruntime_providers_cuda.so in NuGet package
npm error     at Object.download (/home/x/test111/node_modules/onnxruntime-node/script/install-utils.js:176:21)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
npm error     at async installPackages (/home/x/test111/node_modules/onnxruntime-node/script/install-utils.js:107:5)
npm error
npm error Node.js v22.14.0

The errors mentions win-x64 which doesn't look right because it's not the correct platform.

To reproduce

npm install onnxruntime-node

on Linux or WSL2, with CUDA toolkit and cuDNN globally available

Urgency

It potentially causes installation failure when installing any package or application that depends on onnxruntime-node, on Linux.

Workaround

ONNXRUNTIME_NODE_INSTALL=skip npm install onnxruntime-node

Can bypass the issue by preventing the post-install script to try to download the extra files.

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

v1.22.0

Execution Provider

Other / Unknown

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform:webissues related to ONNX Runtime web; typically submitted using template

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions