# fix-path

> Fix the $PATH on macOS and Linux when run from a GUI app

Latest version **5.0.0** (published 2025-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install fix-path
pnpm add fix-path
yarn add fix-path
bun add fix-path
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-09-09 |
| First published | 2015-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 298 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus, silverwind |
| Keywords | fix, path, macos, env, environment, variable, shell, sh, zsh, electron |

## Links

- npm: https://www.npmjs.com/package/fix-path
- Repository: https://github.com/sindresorhus/fix-path
- Homepage: https://github.com/sindresorhus/fix-path#readme
- Issues: https://github.com/sindresorhus/fix-path/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/fix-path

## Dependencies (2)

- [shell-path](https://npm.io/package/shell-path.md) ^3.1.0
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^7.1.2

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 5.0.0 (latest) — 2025-09-09
- 4.0.0 — 2021-08-25
- 3.0.0 — 2020-02-16
- 2.1.0 — 2016-11-09
- 2.0.0 — 2016-04-06
- 1.1.0 — 2015-04-27
- 1.0.0 — 2015-04-27

## README

# fix-path

> Fix the `$PATH` on macOS and Linux when run from a GUI app

Useful for Electron apps as GUI apps on macOS and Linux do not inherit the `$PATH` defined in your dotfiles *(.bashrc/.bash_profile/.zshrc/etc)*.

## Install

```sh
npm install fix-path
```

## Usage

```js
import fixPath from 'fix-path';

console.log(process.env.PATH);
//=> '/usr/bin'

fixPath();

console.log(process.env.PATH);
//=> '/usr/local/bin:/usr/bin'
```

## Related

- [shell-path](https://github.com/sindresorhus/shell-path) - Get the `$PATH` from the shell

---
_Source: https://npm.io/package/fix-path · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
