Skip to content

fix: replace deprecated npm -ws shorthand (fixes broken example/build setup) - #3477

Merged
nkaradzhov merged 1 commit into
redis:masterfrom
nkaradzhov:fix/drop-deprecated-ws-workspaces-flag
Sep 28, 2026
Merged

nkaradzhov merged 1 commit into
redis:masterfrom
nkaradzhov:fix/drop-deprecated-ws-workspaces-flag

Conversation

@nkaradzhov

@nkaradzhov nkaradzhov commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

This pull request resolves #3114 and removes the deprecated npm -ws shorthand across the repository.

Background

Following the documented setup in examples/README.md and doctests/README.md (npm install -ws && npm run build) fails on npm 11 / Node 25. -ws is no longer a valid single-hyphen flag ("−ws is not a valid single-hyphen cli flag and will be removed in the future"); npm installs only the workspaces' runtime dependencies and skips the root devDependencies, so typescript is absent, npm run build fails with sh: tsc: command not found, packages/redis/dist/index.js is never produced, and running an example throws ERR_MODULE_NOT_FOUND. This was reproduced end-to-end on a fresh clone.

Changes

  • 6 install sites (examples/README.md, doctests/README.md, benchmark/lib/ping/ping.yml, benchmark/lib/set-get-delete-string/{1KB,1MB,8B}.yml): npm install -ws → npm install. Plain root install already covers all workspaces and installs root devDependencies, so the build works.
  • 2 test-fan-out sites (package.json test script, .github/actions/run-tests/action.yml): npm run test -ws → npm run test --workspaces. The per-workspace fan-out is intended; only the deprecated spelling changes. This matches the existing release script, and the targeted workspace set is unchanged.

Notes

No runtime/library change; published-package users are unaffected. The two test-script edits are a spelling normalization with an identical workspace fan-out.


Note

Low Risk
Docs, benchmark bootstrap, and npm CLI spelling only; no library or runtime behavior changes.

Overview
Replaces the deprecated npm -ws shorthand so setup and CI work on newer npm (e.g. npm 11), where that flag is invalid and can skip root devDependencies and break npm run build.

Install paths (examples/README.md, doctests/README.md, and four benchmark YAML client configs) now use npm install instead of npm install -ws, which still installs workspaces and root tooling needed for tsc.

Test fan-out in root package.json and .github/actions/run-tests/action.yml uses npm run test --workspaces instead of npm run test -ws, matching the existing release script spelling with the same workspace behavior.

Reviewed by Cursor Bugbot for commit d708246. Bugbot is set up for automated code reviews on this repo. Configure here.

`npm install -ws` is treated as an invalid flag on current npm and installs
only the workspaces' runtime dependencies, skipping the root devDependencies
(including typescript). Following the documented setup then fails: `npm run
build` errors with `tsc: command not found`, packages/redis/dist is never
built, and running an example throws ERR_MODULE_NOT_FOUND (issue redis#3114).

- 6 install sites (examples/README.md, doctests/README.md, benchmark ymls):
  `npm install -ws` -> `npm install`. Plain root install already covers all
  workspaces and installs root devDependencies, so the build works.
- 2 test-fan-out sites (package.json, run-tests action): `npm run test -ws`
  -> `npm run test --workspaces`. Same intended per-workspace fan-out; only
  the deprecated spelling changes. Matches the existing release script.
@nkaradzhov
nkaradzhov requested review from PavelPashov and bobymicroby and removed request for PavelPashov September 28, 2026 09:02
@nkaradzhov
nkaradzhov merged commit c2494d0 into redis:master Sep 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node:internal/modules/esm/resolve:204 - const resolvedOption = FSLegacyMainResolve

2 participants