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

Bug: issue with postinstall scripts in git-hooks package #614

Closed
rjmunro opened this issue Oct 11, 2016 · 8 comments
Closed

Bug: issue with postinstall scripts in git-hooks package #614

rjmunro opened this issue Oct 11, 2016 · 8 comments
Labels

Comments

@rjmunro
Copy link
Contributor

rjmunro commented Oct 11, 2016

Using the following package.json:

{
  "name": "yarn-postinstall-test",
  "version": "1.0.0",
  "description": "Test yarn postinstall functionality",
  "main": "index.js",
  "author": "Jamie Munro (jamie@diffblue.com)",
  "license": "MIT",
  "dependencies": {
    "git-hooks": "1.1.6"
  }
}

and running yarn, I get:

sh: git-hooks: command not found
    at SpawnError (/Users/rjmunro/.nvm/versions/node/v4.4.4/lib/node_modules/yarnpkg/lib-legacy/errors.js:18:1)
    at ChildProcess.<anonymous> (/Users/rjmunro/.nvm/versions/node/v4.4.4/lib/node_modules/yarnpkg/lib-legacy/util/child.js:114:15)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:477:12)

I guess yarn is running git-hook's postinstall too early in the process, or without node_modules/.bin added to the PATH environment variable.

On second run, I don't get the error, but the command doesn't seem to get executed. I have to run node_modules/.bin/git-hooks manually.

@sebmck sebmck added the cat-bug label Oct 11, 2016
@glebmachine
Copy link

+1

@rjmunro
Copy link
Contributor Author

rjmunro commented Oct 12, 2016

@glebmachine Please use the "add reaction" icon at the top right of the bug description to add your +1 (which should be written 👍) - that way it will be counted on the list of bugs when you sort them by reaction counts, e.g. https://github.com/yarnpkg/yarn/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc

@glebmachine
Copy link

@rjmunro got it, thanks)

@rjmunro
Copy link
Contributor Author

rjmunro commented Oct 19, 2016

After upgrading yarn to 0.16.0, I now get the following output:

error /Users/rjmunro/projects/application-server/node_modules/git-hooks: Command failed.
Exit code: 127
Command: sh
Arguments: -c git-hooks --install
Directory: /Users/ubuntu/test/node_modules/git-hooks
Output:
sh: git-hooks: command not found
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

[Edit: it's the same error, but it has hidden the traceback and given me information about the arguments is tried to use etc.]

@glebmachine
Copy link

glebmachine commented Oct 19, 2016 via email

@glebmachine
Copy link

glebmachine commented Oct 28, 2016

Still experience error:

yarn add git-hooks
yarn add v0.16.1
warning package@1.0.0: "dependencies" has dependency "angular-slick-carousel" with range "^3.1.7" that collides with a dependency in "devDependencies" of the same name with version "3.1.7"
warning package@1.0.0: "dependencies" has dependency "scrollmagic" with range "^2.0.5" that collides with a dependency in "devDependencies" of the same name with version "2.0.5"
warning package@1.0.0: "dependencies" has dependency "slick-carousel" with range "^1.6.0" that collides with a dependency in "devDependencies" of the same name with version "1.6.0"
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
⠁ 
⠁ 
⠁ 
⠁ 
error ..../node_modules/git-hooks: Command failed.
Exit code: 127
Command: sh
Arguments: -c git-hooks --install
Directory: ..../node_modules/git-hooks
Output:
sh: git-hooks: command not found
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

@DanielZlotin
Copy link

DanielZlotin commented Nov 2, 2016

maybe related to #760 #1210 ?

@sebmck
Copy link
Contributor

sebmck commented Nov 3, 2016

Fixed via #1210.

@sebmck sebmck closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants