diff --git a/.changeset/allow-node-pty-install-scripts.md b/.changeset/allow-node-pty-install-scripts.md
new file mode 100644
index 0000000..ce66ee0
--- /dev/null
+++ b/.changeset/allow-node-pty-install-scripts.md
@@ -0,0 +1,5 @@
+---
+"@jmfederico/pi-web": patch
+---
+
+Allow npm 12 global installs and updates to run node-pty's required native-module installation scripts, and diagnose blocked native modules before installing services.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 57788c6..283cc38 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,5 +38,9 @@ jobs:
- name: Build
run: npm run build
+ - name: Smoke test npm 12 global package install
+ if: runner.os == 'Linux'
+ run: npm run smoke:package-install
+
- name: Check npm package contents
run: npm run pack:dry
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 96c2959..430ebeb 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -34,5 +34,8 @@ jobs:
- name: Build
run: npm run build
+ - name: Smoke test npm 12 global package install
+ run: npm run smoke:package-install
+
- name: Publish
run: npm publish --access public --provenance
diff --git a/README.md b/README.md
index d33c958..ddfdff1 100644
--- a/README.md
+++ b/README.md
@@ -42,11 +42,13 @@ Requirements:
Install and start PI WEB as per-user services:
```bash
-npm install -g @jmfederico/pi-web
+npm install -g @jmfederico/pi-web --allow-scripts=node-pty
pi-web install
pi-web doctor
```
+On npm 12, the scoped flag lets `node-pty` prepare its required native module without enabling install scripts for other dependencies.
+
Then open:
```text
diff --git a/docker/Dockerfile b/docker/Dockerfile
index f14fa02..15fcacd 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -30,7 +30,7 @@ ARG CACHE_BUST=local
RUN set -eux; \
echo "PI WEB Docker build cache bust: ${CACHE_BUST}"; \
- npm install -g --omit=dev --include=peer --no-audit --no-fund "@jmfederico/pi-web@${PI_WEB_VERSION}"; \
+ npm install -g --omit=dev --include=peer --no-audit --no-fund "@jmfederico/pi-web@${PI_WEB_VERSION}" --allow-scripts=node-pty; \
global_root="$(npm root -g)"; \
global_prefix="$(npm prefix -g)"; \
peer_pi_bin="${global_root}/@jmfederico/pi-web/node_modules/.bin/pi"; \
diff --git a/docs/faq.html b/docs/faq.html
index 4030bf0..1feca7c 100644
--- a/docs/faq.html
+++ b/docs/faq.html
@@ -94,6 +94,7 @@
Tools are failing / node not foundWhat does doctor check?nvm, fnm, or asdf issues
+ node-pty native module is missingUser service manager is unavailableI cannot open the web UICan I expose this publicly?
@@ -112,7 +113,7 @@
a supported per-user service manager when one is available.
-
User-service install: use npm install -g @jmfederico/pi-web and pi-web install.
+
User-service install: use npm install -g @jmfederico/pi-web --allow-scripts=node-pty and pi-web install.
WSL: if your distro has systemd enabled, the installer may work; otherwise use the manual run path.
Native Windows: outside WSL is not the recommended path today.
@@ -166,8 +167,9 @@
Missing plan requirements fail doctor and include login-file guidance. Manager, timeout, malformed-output,
and cleanup failures are reported as probe infrastructure problems rather than being mislabeled as PATH
- drift. On unsupported/manual-only platforms, native-service drift checks are skipped. Doctor also prints
- installed and running PI WEB versions and reports systemd lingering when relevant.
+ drift. On unsupported/manual-only platforms, native-service drift checks are skipped. Doctor also checks
+ that the node-pty native module can load, prints installed and running PI WEB versions, and reports
+ systemd lingering when relevant.
@@ -186,6 +188,27 @@
+
+
pi-web-sessiond cannot load pty.node
+
+ npm 12 blocks dependency installation scripts unless they are explicitly approved. If PI WEB was installed
+ without approving node-pty, its required native module can be missing even though npm reported a
+ successful installation.
+
+
Reinstall PI WEB with approval limited to node-pty:
+ Then run pi-web install again, or restart pi-web-sessiond if you run PI WEB manually.
+ The flag does not enable installation scripts for other dependencies.
+
+
+
User service manager is unavailable
diff --git a/docs/index.html b/docs/index.html
index d18ba83..b79e41e 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -337,7 +337,7 @@
User service install
-
$ npm install -g @jmfederico/pi-web
+
$ npm install -g @jmfederico/pi-web --allow-scripts=node-pty
$ pi-web install
$ pi-web doctor
$ pi-web version
diff --git a/docs/install.html b/docs/install.html
index 8b3b4e2..c4985fc 100644
--- a/docs/install.html
+++ b/docs/install.html
@@ -133,10 +133,14 @@
User service install
-
+ The scoped --allow-scripts=node-pty flag lets npm 12 run the native-module installation required
+ by PI WEB terminals without enabling install scripts for other dependencies.
+
If preflight fails, no config or existing services are changed. Follow the detected shell guidance: zsh services read ~/.zprofile, not interactive-only ~/.zshrc; bash uses ~/.bash_profile or ~/.profile.
On Linux servers, also consider sudo loginctl enable-linger "$USER" so user services survive logout/reboot.
@@ -185,7 +189,7 @@
Manual processes
-
$ npm install -g @jmfederico/pi-web
+
$ npm install -g @jmfederico/pi-web --allow-scripts=node-pty
# Terminal 1$ pi-web-sessiond
diff --git a/docs/machines.html b/docs/machines.html
index cf10fa5..2347b1d 100644
--- a/docs/machines.html
+++ b/docs/machines.html
@@ -167,7 +167,7 @@ PI WEB gateway you opened
Install on each target
-