Skip to content

prepare script fails when installing from npm registry #287

@bryan-anthropic

Description

@bryan-anthropic

When installing @ui5/mcp-server@0.2.9 from the npm registry, the prepare lifecycle script fails because .husky/skip.js is not included in the published tarball:

> @ui5/mcp-server@0.2.9 prepare > node ./.husky/skip.js || husky Error: Cannot find module '/tmp/tmp.xxx/package/.husky/skip.js' sh: 1: husky: not found npm error code 127 

Steps to reproduce

npm pack @ui5/mcp-server@0.2.9 mkdir test && tar xzf ui5-mcp-server-0.2.9.tgz -C test cd test/package npm install # fails with exit code 127

The tarball contains 282 files, none from .husky/. The prepare script references .husky/skip.js which exists in the repo but is excluded from the published package. Since husky is a devDependency, the fallback || husky also fails.

This affects any consumer that installs with lifecycle scripts enabled (e.g., Docker-based CI builds).

Suggested fixes

  1. Include .husky/skip.js in the published tarball (add .husky to the files field in package.json)
  2. Use pinst to disable prepare in published packages
  3. Guard inline: "prepare": "test -f .husky/skip.js && node .husky/skip.js || true"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions