Skip to content

Fix npm global prefix fallback#55

Merged
konard merged 3 commits into
mainfrom
issue-54-405adccd9a8d
Jun 12, 2026
Merged

Fix npm global prefix fallback#55
konard merged 3 commits into
mainfrom
issue-54-405adccd9a8d

Conversation

@konard

@konard konard commented Jun 12, 2026

Copy link
Copy Markdown
Member

Fixes #54

Summary

  • Preflight the npm global root before npm-backed installs and redirect installs to a use-m-owned cache prefix when the configured root is not writable.
  • Preserve explicit npm_config_prefix / NPM_CONFIG_PREFIX choices instead of overriding them, with an actionable error if the configured root is not writable.
  • Apply the npm resolver change across use.mjs, use.cjs, and use.js, plus a sync regression test to keep those distributed entrypoints aligned.
  • Refresh Deno remote integrity and harden current TypeScript/Bun-related tests so CI matches the current runtime/toolchain behavior.

Reproduction And Verification

  • Added fake-npm regression tests for a non-writable global root, a writable default root, and an explicit configured prefix.
  • The non-writable case simulates npm root -g under /sys/...; the resolver now installs into ${XDG_CACHE_HOME}/use-m/npm-global by passing npm_config_prefix to npm.

Tests

  • npm test -- --runInBand
  • bun test
  • deno test --allow-net --allow-env --allow-run --allow-read --allow-write --allow-sys

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #54
@konard konard self-assigned this Jun 12, 2026
@konard konard changed the title [WIP] Detect non-writable npm global prefix before npm install -g Fix npm global prefix fallback Jun 12, 2026
@konard konard marked this pull request as ready for review June 12, 2026 09:55
@konard

konard commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented and pushed the fix to PR 55:

#55

What changed:

  • npm resolver now checks npm root -g before install and falls back to ${XDG_CACHE_HOME}/use-m/npm-global / ~/.cache/use-m/npm-global when the global root is not writable.
  • Explicit npm_config_prefix / NPM_CONFIG_PREFIX is respected.
  • use.mjs, use.cjs, and use.js were updated together.
  • Added regression tests for non-writable global roots, writable roots, explicit prefixes, and a sync guard for the three distributed scripts.
  • Fixed current CI drift in TypeScript expectations, Bun runtime detection contamination, and Deno lock integrity.

Verification:

  • npm test -- --runInBand
  • bun test
  • deno test --allow-net --allow-env --allow-run --allow-read --allow-write --allow-sys
  • Fresh GitHub Tests workflow: passed
  • Fresh GitHub CI/CD workflow: passed

PR 55 is marked ready for review, merge state is clean, and the local worktree is clean at 30e5049.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.5
  • Provider: OpenAI
  • Public pricing estimate: $12.431564

📊 Context and tokens usage:

  • 296.7K / 1.1M (28%) input tokens, 46.6K / 128K (36%) output tokens

Total: (296.7K + 7.4M cached) input tokens, 46.6K output tokens, $12.431564 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Log file uploaded as Repository (59333KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard konard merged commit fb3e343 into main Jun 12, 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.

Detect non-writable npm global prefix before npm install -g

1 participant