New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

edge-location

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edge-location

Approximates the current location of the Edge browser across platforms.

latest
Source
npmnpm
Version
2.0.5
Version published
Weekly downloads
2.1K
-33.29%
Maintainers
1
Weekly downloads
 
Created
Source

Approximates the current location of the Edge browser across platforms.

edge-location Version Downloads workflow

Edge
  • By default checks only stable. Optionally can cascade to beta / dev / canary.
  • Supports macOS / Windows / Linux
  • Works both as an ES module or CommonJS

New in this version:

  • Honors environment override: EDGE_BINARY
  • Optional helper to throw with a friendly install guide when nothing is found
  • Install guidance uses Playwright for Edge: npx playwright install msedge

Support table

This table lists the default locations where Edge is typically installed for each supported platform and channel. By default, only the Stable channel is checked. When fallback is enabled, the package checks these paths (in order) and returns the first one found.

PlatformChannelPaths checked

macOS
Edge (Stable)
  • /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
  • ~/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge
Edge Beta
  • /Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta
  • ~/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta
Edge Dev
  • /Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev
  • ~/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev
Edge Canary
  • /Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary
  • ~/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary

Windows
Edge (Stable)
  • %LOCALAPPDATA%\\Microsoft\\Edge\\Application\\msedge.exe
  • %PROGRAMFILES%\\Microsoft\\Edge\\Application\\msedge.exe
  • %PROGRAMFILES(X86)%\\Microsoft\\Edge\\Application\\msedge.exe
Edge Beta
  • %LOCALAPPDATA%\\Microsoft\\Edge Beta\\Application\\msedge.exe
  • %PROGRAMFILES%\\Microsoft\\Edge Beta\\Application\\msedge.exe
  • %PROGRAMFILES(X86)%\\Microsoft\\Edge Beta\\Application\\msedge.exe
Edge Dev
  • %LOCALAPPDATA%\\Microsoft\\Edge Dev\\Application\\msedge.exe
  • %PROGRAMFILES%\\Microsoft\\Edge Dev\\Application\\msedge.exe
  • %PROGRAMFILES(X86)%\\Microsoft\\Edge Dev\\Application\\msedge.exe
Edge Canary
  • %LOCALAPPDATA%\\Microsoft\\Edge SxS\\Application\\msedge.exe
  • %PROGRAMFILES%\\Microsoft\\Edge SxS\\Application\\msedge.exe
  • %PROGRAMFILES(X86)%\\Microsoft\\Edge SxS\\Application\\msedge.exe

Linux/other
Edge (Stable)
  • microsoft-edge (on $PATH)
Edge Beta
  • microsoft-edge-beta (on $PATH)
Edge Dev
  • microsoft-edge-dev (on $PATH)
Edge Canary
  • microsoft-edge-canary (on $PATH)

Returns the first existing path found (given selected channels), or null if none are found.

Usage

Via Node.js (strict by default):

import edgeLocation from 'edge-location'

// Strict (Stable only)
console.log(edgeLocation())
// => "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" or null

// Enable fallback (Stable / Beta / Dev / Canary)
console.log(edgeLocation(true))
// => first found among Stable/Beta/Dev/Canary or null

// Throw with a friendly, copy-pasteable guide when not found
import {locateEdgeOrExplain, getInstallGuidance} from 'edge-location'
try {
  const path = locateEdgeOrExplain({allowFallback: true})
  console.log(path)
} catch (e) {
  console.error(String(e))
  // Or print getInstallGuidance() explicitly
}

Via CLI:

npx edge-location
# Strict (Stable only)

npx edge-location --fallback
# Enable cascade (Stable / Beta / Dev / Canary)

# Respect environment overrides
EDGE_BINARY=/custom/path/to/msedge npx edge-location

# If not found, install Edge via Playwright and re-run
npx playwright install msedge

Environment overrides

If this environment variable is set and points to an existing binary, it takes precedence:

  • EDGE_BINARY

When nothing is found

The helper returns actionable guidance:

We couldn't find a Microsoft Edge browser on this machine.

Here's the fastest way to get set up:

1) Install Edge via Playwright (recommended for CI/dev)
   npx playwright install msedge

Then re-run your command — we'll detect it automatically.

Alternatively, install Microsoft Edge from the official site and re-run.

API

  • default export locateEdge(allowFallback?: boolean): string | null

    • Returns the first existing path among the selected channels or null.
    • When allowFallback is true, checks Stable → Beta → Dev → Canary.
  • locateEdgeOrExplain(options?: boolean | { allowFallback?: boolean }): string

    • Returns a path if found, otherwise throws an Error with a friendly installation guide.
  • getEdgeVersion(bin: string, opts?: { allowExec?: boolean }): string | null

    • Cross-platform version resolver that does not execute the browser by default.
    • Windows: reads PE file metadata via PowerShell (no GUI spawn).
    • macOS: reads Info.plist (no GUI spawn).
    • Linux/other: returns null unless allowExec is true, then tries --version.
  • getInstallGuidance(): string

    • Returns the same guidance text used by locateEdgeOrExplain().

License

MIT (c) Cezar Augusto.

Keywords

edge

FAQs

Package last updated on 01 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts