Skip to content

Installing fails to create binary — missing prepare script #58

@gg-mmill

Description

@gg-mmill

When installing with yarn: yarn global add czottmann/linearis

The linearis binary is not created. yarn global list shows the package and its binary, but the symlink in ~/.yarn/bin/ is missing.

Cause: The bin field points to dist/main.js, but dist/ is not committed to the repo and there is no prepare (or preinstall) script in package.json to run the build step. Yarn fetches the source, finds no dist/main.js, and skips the symlink.

Workaround:

  cd "$(yarn global dir)/node_modules/linearis"
  npm install && npm run build
  ln -s "$(yarn global dir)/node_modules/linearis/dist/main.js" "$(yarn global bin)/linearis"

Suggested fix: Add a prepare script to package.json:

  "scripts": {
    "prepare": "tsc && chmod +x dist/main.js",
    ...
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions