Skip to content

yarn does not run lifecycle scripts when installing from repository #2815

Closed
@cwmoo740

Description

@cwmoo740

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Installing a dependency from a git repository does not run lifecycle scripts.

If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/cwmoo740/yarn-lifecycle-github

mkdir test-lifecycle
cd test-lifecycle
yarn init
yarn add git+https://git@github.com:cwmoo740/yarn-lifecycle-github.git

What is the expected behavior?
I expect it to run lifecycle scripts like NPM.

mkdir test-lifecycle
cd test-lifecycle
npm init
npm install --save git+https://git@github.com:cwmoo740/yarn-lifecycle-github.git

/**
> yarn-lifecycle-github@1.0.0 preinstall /home/cowmoo/src/test-lifecycle/node_modules/.staging/yarn-lifecycle-github-26d1bc2f
> echo 'PREINSTALL'

PREINSTALL

> yarn-lifecycle-github@1.0.0 install /home/cowmoo/src/test-lifecycle/node_modules/yarn-lifecycle-github
> echo 'INSTALL'

INSTALL

> yarn-lifecycle-github@1.0.0 postinstall /home/cowmoo/src/test-lifecycle/node_modules/yarn-lifecycle-github
> echo 'POSTINSTALL'

POSTINSTALL
*/

Please mention your node.js, yarn and operating system version.
node=v7.6.0
yarn=0.21.3
npm=4.3.0
OS=arch linux

My current project develops on our own git server and we are not allowed to publish to npm. We also have not set up a private mirror yet, so we install packages directly from our git server. Currently yarn doesn't use .npmignore or .yarnignore or any lifecycle scripts when installing from a repository, unlike npm.

The related .npmignore issue: #2090

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