Skip to content

[BUG] When installing a git dependency, prepare script can see dev dependencies, prepack script can not #1229

Closed
@trusktr

Description

@trusktr

What

When a project has a dependency from git that has a prepack script (instead of a prepare script), the prepack step of the git dependency fails because dev dependencies are not present to the prepack script.

This issue is not happening if the git dependencies use prepare instead of prepack.

When

Whenever I run npm install in my project, and the git dependencies have a prepack script instead of a prepare script.

Where

Git dependencies. I haven't made a public reproduction yet.

How

Publish a package in a git repo. Make sure it uses prepack in its package.json to define the steps needed to build the projects into usable state.

Current Behavior

My project's npm install fails because a git dependency's prepack script fails to find the commands that it uses.

If I fork the git dependency and modify it to use prepare, then things work great.

Steps to Reproduce

  • Publish a package as a git repo
  • Make sure the package uses prepack to run the steps needed to build it (f.e. build from src/ to dist/). Make sure this prepack script relies on executables installed as dev dependencies.
  • Make another project that depends on the dependency from git.
  • Run npm install in the project that depends on the git dependency.
  • The prepack step in the git dependency should fail.

Expected Behavior

prepack should work the same as prepare in this regard.

Who

Me, but hopefully I'm not the only one!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 6.xwork is associated with a specific npm 6 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions