Tuesday, 15 July 2025

Sitecore XM Cloud + Netlify :: Netlify CLI and Deno installation issue

During a recent project, I encountered a strange issue while deploying a Sitecore XM Cloud solution to a new Netlify environment. The problem was related to Deno installation, which unexpectedly disrupted the deployment process. If you've run into a similar issue—or you're just curious about what Deno is and how it ties into Netlify—keep reading. I’ll walk you through what happened, explain what Deno is, and show you how to resolve the issue.


Deno is a modern, secure runtime for JavaScript and TypeScript, created by Ryan Dahl — the original creator of Node.js. It was designed to fix some of the design decisions and security concerns that Node.js has.

Key Features of Deno:

Built-in TypeScript support (no need for a separate build step).

  • Secure by default — no file, network, or environment access unless explicitly allowed.
  • Ships as a single binary (deno.exe or deno on Unix).
  • Uses modern ES modules instead of CommonJS.
  • Built on Rust + V8.Edge Functions bundling

Netlify uses Deno to run Edge Functions — these are lightweight serverless functions that execute at the edge, close to the user, minimizing latency.
if you install deno using npm or pnpm you may end up getting the below error, which is caused by the way you installed deno: 



🛠️ How to Fix the Deno Installation Issue on Windows (for Netlify Deploy)


If you're running into problems with Deno during a Netlify deployment, especially when working with Sitecore XM Cloud, the root cause is often an incorrect Deno installation — particularly if it was installed via npm or pnpm. Deno is not a Node.js package and should not be installed that way.

Here’s a step-by-step guide to properly install Deno and resolve the issue:

✅ Step 1: Check Your Current Deno Installation

Open Windows PowerShell and run:
Get-Command deno

If the output path points to anything other than:
C:\Users\<your-username>\.deno\bin\deno.exe

then you should remove that installation. Deno needs to be in its native location, not managed by a Node package manager.


✅ Step 2: Install Deno Properly

Use the official Deno installation script for PowerShell:
iwr https://deno.land/install.ps1 -useb | iex
This installs Deno in the correct directory:
C:\Users\<your-username>\.deno\bin\

✅ Step 3: Add Deno to Your PATH

Make sure your shell session knows where to find Deno:
$env:PATH = "C:\Users\<your-username>\.deno\bin;$env:PATH"

Replace <your-username> with your actual Windows username.
To make this change permanent, you can add the path to your User Environment Variables in the System Settings.

✅ Step 4: Restart PowerShell

Close and reopen your PowerShell session, then verify Deno is correctly recognized:
Get-Command deno
You should see the correct path listed.

✅ Step 5: Deploy Again

Now, try running:
netlify deploy


Everything should work smoothly, and the Deno-related error should be gone. If you’re still facing issues after these steps, double-check that no conflicting Deno installations exist in your global npm or pnpm modules, and ensure your PATH variable is clean.


Hopefully, this walkthrough saves you some time and frustration during your Next.j, Sitecore XM Cloud and Netlify builds. Happy coding!


No comments:

Post a Comment