Skip to content

Commit 813380c

Browse files
committed
docs(install): improve npm guidance and Windows note
- clarify per-project vs global vs one-shot npm usage - scope package.json snippet to per-project install - add EBADPLATFORM warning for native Windows + WSL fix - use json-vue so pkg.version auto-interpolates in sample
1 parent 455c300 commit 813380c

2 files changed

Lines changed: 34 additions & 6 deletions

File tree

docs/installation.md

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,18 @@ Committing (or not) this file to your project it's up to you. In the end, it is
8484

8585
::: code-group
8686
```bash [Per-project (recommended)]
87+
# Install as dev dependency
8788
npm install --save-dev bashunit
89+
90+
# Run via npx (resolves node_modules/.bin/bashunit)
8891
npx bashunit tests/
8992
```
9093

9194
```bash [Global]
95+
# Install on PATH
9296
npm install -g bashunit
97+
98+
# Run directly, no npx needed
9399
bashunit tests/
94100
```
95101

@@ -99,21 +105,43 @@ npx bashunit@latest tests/
99105
```
100106
:::
101107

102-
Add a script to your `package.json` so contributors and CI run the same command:
108+
### Per-project: `package.json` script
109+
110+
Only relevant for the per-project install (global and one-shot don't touch `package.json`).
111+
Define a script so contributors and CI share one command:
103112

104-
```json
113+
```json-vue
105114
{
106115
"scripts": {
107-
"test:sh": "bashunit tests/"
116+
"test": "bashunit tests/"
108117
},
109118
"devDependencies": {
110119
"bashunit": "^{{ pkg.version }}"
111120
}
112121
}
113122
```
114123

124+
Then run:
125+
126+
```bash
127+
npm test
128+
# or any custom script name
129+
npm run <script-name>
130+
```
131+
132+
::: warning Windows (native) not supported
133+
The npm package declares `"os": ["darwin", "linux"]`, so `npm install bashunit` on native Windows (PowerShell / cmd) fails with `EBADPLATFORM`:
134+
135+
```text
136+
npm error code EBADPLATFORM
137+
npm error notsup Unsupported platform for bashunit@x.y.z: wanted {"os":"darwin,linux"} (current: {"os":"win32"})
138+
```
139+
140+
Fix: install [WSL](https://learn.microsoft.com/windows/wsl/install) and run `npm install --save-dev bashunit` inside the WSL shell. Alternatively use the [`install.sh`](#install-sh) route from WSL.
141+
:::
142+
115143
::: warning
116-
The npm package only ships the prebuilt single-file binary (no `src/` tree), and is restricted to `darwin` and `linux`. You cannot `source` internals from `node_modules/bashunit/` - use the `bashunit` command. To vendor or extend the framework, use [install.sh](#install-sh) or clone the repository.
144+
The npm package only ships the prebuilt single-file binary (no `src/` tree). You cannot `source` internals from `node_modules/bashunit/` - use the `bashunit` command. To vendor or extend the framework, use [install.sh](#install-sh) or clone the repository.
117145
:::
118146

119147
## Brew

docs/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ curl -s https://bashunit.typeddevs.com/install.sh | bash
1717
```
1818

1919
```bash [npm]
20-
# Per-project: pinned in package.json, run via npx
20+
# Per-project (pinned in package.json), run via npx
2121
npm install --save-dev bashunit
2222
npx bashunit tests/
2323

24-
# Or global
24+
# Global install, run directly on PATH
2525
npm install -g bashunit
2626
bashunit tests/
2727
```

0 commit comments

Comments
 (0)