Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Error when installed using NPM #6

Closed
KenKappler opened this issue Oct 14, 2015 · 15 comments
Closed

Error when installed using NPM #6

KenKappler opened this issue Oct 14, 2015 · 15 comments

Comments

@KenKappler
Copy link

This may also be linked t this issue raised on the embark framework: embarklabs/embark#99

Kens-MacBook-Air:~ KenKappler$ npm install ethereumjs-tx

> [email protected] install /Users/KenKappler/node_modules/ethereumjs-tx/node_modules/secp256k1
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/functions.o
../functions.cc:224:57: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results = secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                        ^~~~~~~
../functions.cc:223:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
../functions.cc:248:56: warning: variable 'pub_key' is uninitialized when used here [-Wuninitialized]
  int results= secp256k1_ec_pubkey_parse(secp256k1ctx, pub_key, pk_data, pub_len);
                                                       ^~~~~~~
../functions.cc:247:30: note: initialize the variable 'pub_key' to silence this warning
  secp256k1_pubkey_t *pub_key;
                             ^
                              = nullptr
2 warnings generated.
  CXX(target) Release/obj.target/secp256k1/util.o
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
  CC(target) Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o
In file included from ../secp256k1-src/src/secp256k1.c:12:
In file included from ../secp256k1-src/src/num_impl.h:14:
In file included from ../secp256k1-src/src/num.h:17:
../secp256k1-src/src/num_gmp.h:10:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
         ^
1 error generated.
make: *** [Release/obj.target/secp256k1/secp256k1-src/src/secp256k1.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/KenKappler/node_modules/ethereumjs-tx/node_modules/secp256k1
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

> [email protected] install /Users/KenKappler/node_modules/ethereumjs-tx/node_modules/ethereumjs-util/node_modules/sha3
> node-gyp rebuild

  CXX(target) Release/obj.target/sha3/src/addon.o
  CXX(target) Release/obj.target/sha3/src/displayIntermediateValues.o
  CXX(target) Release/obj.target/sha3/src/KeccakF-1600-reference.o
  CXX(target) Release/obj.target/sha3/src/KeccakNISTInterface.o
  CXX(target) Release/obj.target/sha3/src/KeccakSponge.o
  SOLINK_MODULE(target) Release/sha3.node
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ethereumjs-tx"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the secp256k1 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls secp256k1
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/KenKappler/npm-debug.log

npm debug log:
https://gist.github.com/KenKappler/3711fd9c9068f85f00f3

@wanderer
Copy link
Member

thanks @KenKappler what OS are you running?

@KenKappler
Copy link
Author

MAC OSX el capitan

@kumavis
Copy link
Member

kumavis commented Oct 15, 2015

guess I wont be upgrading soon...

@tcoulter
Copy link
Contributor

@kumavis you lucky dog. I already did...

@KenKappler
Copy link
Author

I'm actually getting the same issue on yosemite as well....

@wanderer
Copy link
Member

ok guys this is got a be related to GMP depency not being installed. secp256k1 has a script to test if gmp is installed or not. I'm guessing it giving a false positive. I would love some help testing this on mac. Could you download https://github.com/wanderer/secp256k1-node/blob/master/utils/has_lib.sh and run ./has_lib.sh gmpxx?

@tcoulter
Copy link
Contributor

@wanderer

Tims-MacBook-Pro:Consensys tim$ ./has_lib.sh 
true

@tcoulter
Copy link
Contributor

Whoops, looks like I ran the wrong thing:

@wanderer

Tims-MacBook-Pro:Consensys tim$ ./has_lib.sh gmpxx
true

@wanderer
Copy link
Member

@KenKappler can you please try install the latest version of secp256k1?
git clone [email protected]:wanderer/secp256k1-node.git
cd secp256k1-node
git submodule update --init --recursive
npm install

Let me know what happens! thanks.

@taoeffect
Copy link

See related discussion in cryptocoinjs/secp256k1-node#35

@taoeffect
Copy link

This should be fixed as soon as @wanderer merges cryptocoinjs/secp256k1-node#36 and publishes new version to NPM.

@wanderer
Copy link
Member

@taoeffect @KenKappler alright just push ethereumjs-tx 0.6.9 with the updated secp256k1

@stan101010
Copy link

FYI - I had the same issue after I installed MAC OSX el capitan and I was able to fix it by running the following command:

xcode-select --install

@yogiben
Copy link

yogiben commented Jun 27, 2016

@stanacton thanks for alleviating my insanity

@theotow
Copy link

theotow commented Jul 18, 2016

@stanacton thanks

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

No branches or pull requests

8 participants