Homebrew-core: RuntimeError: npm failed to pack

Created on 27 Jun 2017  路  5Comments  路  Source: Homebrew/homebrew-core

- What you were trying to do (and why)
Add a formula to the shopify/shopify tap and allow for anyone that has Brew to download Slate. Formula can be https://github.com/Shopify/homebrew-shopify/blob/master/slate.rb

- What happened (include command output)

--- ~ 禄 brew install --verbose --debug shopify/shopify/slate
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/slate.rb
==> Installing slate from shopify/shopify
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/slate.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/icu4c.rb
/usr/local/Homebrew/Library/Homebrew/build.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/pkg-config.rb
==> Downloading https://registry.npmjs.org/@shopify/slate/-/slate-0.10.0.tgz
Already downloaded: /Users/chris.berthe/Library/Caches/Homebrew/slate-0.10.0.tgz
==> Verifying slate-0.10.0.tgz checksum
tar xzf /Users/chris.berthe/Library/Caches/Homebrew/slate-0.10.0.tgz
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
RuntimeError: npm failed to pack /private/tmp/slate-20170627-2913-577r1m/package
1. raise
2. ignore
3. backtrace
4. irb
5. shell
Choose an action: 1
==> Kept temporary files
Temporary files retained at /tmp/slate-20170627-2913-577r1m
Error: npm failed to pack /private/tmp/slate-20170627-2913-577r1m/package
/usr/local/Homebrew/Library/Homebrew/debrew.rb:11:in `raise'
/usr/local/Homebrew/Library/Homebrew/language/node.rb:14:in `pack_for_installation'
/usr/local/Homebrew/Library/Homebrew/language/node.rb:41:in `std_npm_install_args'
/usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/slate.rb:13:in `install'
/usr/local/Homebrew/Library/Homebrew/debrew.rb:22:in `block in install'
/usr/local/Homebrew/Library/Homebrew/debrew.rb:97:in `debrew'
/usr/local/Homebrew/Library/Homebrew/debrew.rb:22:in `install'
/usr/local/Homebrew/Library/Homebrew/build.rb:137:in `block in install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1148:in `block in brew'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1960:in `block in stage'
/usr/local/Homebrew/Library/Homebrew/resource.rb:98:in `block in unpack'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:14:in `block in mktemp'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `block in run'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `chdir'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:74:in `run'
/usr/local/Homebrew/Library/Homebrew/extend/fileutils.rb:13:in `mktemp'
/usr/local/Homebrew/Library/Homebrew/resource.rb:94:in `unpack'
/usr/local/Homebrew/Library/Homebrew/resource.rb:86:in `stage'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1939:in `stage'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1143:in `brew'
/usr/local/Homebrew/Library/Homebrew/build.rb:112:in `install'
/usr/local/Homebrew/Library/Homebrew/build.rb:189:in `<main>'

- What you expected to happen
For Slate to download (which it does) and install (which it doesn't).

- Step-by-step reproduction instructions (by running brew install commands)
brew install shopify/shopify/slate

Most helpful comment

Yeah, this should be fixed by https://github.com/Homebrew/brew/pull/2826/commits/aad7173aae2f333e4de99e79f1b2ca9ba6c0fbca and https://github.com/Homebrew/brew/pull/2826/commits/4cd361491d69889d3109ba0962abc4a4280bd7c1. The problem atm is, that our 'get the package name from the npm pack output'-logic is not robust against verbose output from prepublish scripts (1. commit) and that the prepublish script is unecessary run after pulling a registry tarball (2. commit).

I can confirm that your formula builds successfully with these commits applied to language/node.

All 5 comments

This should be fixed by https://github.com/Homebrew/brew/pull/2826.

CC @chrmoritz

Yeah, this should be fixed by https://github.com/Homebrew/brew/pull/2826/commits/aad7173aae2f333e4de99e79f1b2ca9ba6c0fbca and https://github.com/Homebrew/brew/pull/2826/commits/4cd361491d69889d3109ba0962abc4a4280bd7c1. The problem atm is, that our 'get the package name from the npm pack output'-logic is not robust against verbose output from prepublish scripts (1. commit) and that the prepublish script is unecessary run after pulling a registry tarball (2. commit).

I can confirm that your formula builds successfully with these commits applied to language/node.

Closing since the underlying formula is not in homebrew/core and this is being handled by https://github.com/Homebrew/brew/pull/2826. Thanks for reporting the problem @chrisberthe!

Np, thank you guys.

@chrisberthe this is fixed now that the brew 1.2.4 tag just shipped. brew update should take care of it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daviderestivo picture daviderestivo  路  4Comments

sstadick picture sstadick  路  4Comments

Thirudhas picture Thirudhas  路  4Comments

jyutzler picture jyutzler  路  4Comments

BluePawDev picture BluePawDev  路  3Comments