Repository navigation
Conversation
npm 12 doesn't run the install scripts of dependencies unless they are allowed, and for npm install -g it doesn't read the allowScripts in the installed package's package.json. sqlite3, better-sqlite3 and roaring are then left without their binary. The README install command and the published install check now pass --allow-scripts. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On top of #473 (base is its branch). Makes the "Published install (npm latest)" leg pass and documents the install command npm 12 needs.
Cause
npm 12 doesn't run the install scripts of dependencies unless they are allowed, and for
npm install -git doesn't read theallowScriptsin the installed package's package.json: only the command line or the user's npm config counts. sqlite3, better-sqlite3 and roaring get their native binary from an install script, so a plainnpm install -g fhirsmithwith npm 12 ends without an error and the server can't load them. bcrypt and koffi load anyway.This isn't specific to 1.1.0. Installed from the registry into a scratch prefix, Node 24.16.0:
--allow-scripts=...The tar shim plays no part:
vendor/isn't in the package and npm doesn't apply a package'soverrideswhen the package is itself installed (every nestedtarin the 1.1.0 install is plain tar 7.5.24). What is new in 1.1.0 is that roaring is a dependency, so it joins the blocked list.Changes
published-install-check.yml: both legs install with--allow-scripts=bcrypt,better-sqlite3,koffi,roaring,sqlite3(the list npm itself prints)npm config set allow-scripts=... --location=user)ips/vendor/fix from fix .npmignore, and add test for working npm image #473 and thisChecked
This branch packed and installed with that command under npm 11.21.3 and npm 12.2.3, then
check-installed-package.json the installed copy: complete, all five native modules load,ips/vendor/has its 5 files.Installing with npm 12
With npm 12 the install command needs one extra argument:
The package can't set this for the user, so it goes in the README as the install command.
🤖 Generated with Claude Code