Thursday, February 22, 2024

ReferenceError: XMLHttpRequest is not defined - Ollama Java Script

I encountered the following error while using Ollama JavaScript on my local system.

ReferenceError: XMLHttpRequest is not defined

    at \Development\ollama\js\node_modules\whatwg-fetch\dist\fetch.umd.js:540:17

    at new Promise (<anonymous>)

    at fetch (\Development\ollama\js\node_modules\whatwg-fetch\dist\fetch.umd.js:533:12)

    at file:////Development/ollama/js/node_modules/ollama/dist/utils.js:77:28

    at Generator.next (<anonymous>)

    at file:////Development/ollama/js/node_modules/ollama/dist/utils.js:7:71

    at new Promise (<anonymous>)

    at __awaiter (file:////Development/ollama/js/node_modules/ollama/dist/utils.js:3:12)

    at Module.post (file:////Development/ollama/js/node_modules/ollama/dist/utils.js:72:53)

    at Ollama.<anonymous> (file:////Development/ollama/js/node_modules/ollama/dist/index.js:59:42)

The actual issue was with the node and npm versions, please ensure the latest node/npm version is installed on your system before running the Ollama JS in your local system.

  • Node v20.11.0+
  • NPM v10.2.4+


No comments:

Post a Comment