Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cwmoo740 opened this issue Mar 1, 2017 · 1 comment
Closed

Comments

@cwmoo740
Copy link

cwmoo740 commented Mar 1, 2017

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

@cwmoo740
Copy link
Author

cwmoo740 commented Mar 1, 2017

I made a mistake. Yarn does run preinstall, install, and postinstall for repositories, it just silences the output. Changing the scripts to "touch INSTALL" revealed this.

Feel free to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant