Git Product home page Git Product logo

ethereumjs-accounts's People

Contributors

genecyber avatar tayzlor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereumjs-accounts's Issues

Important notes about how account encryption works

I've created a library (called ethereumjs-wallet) for handling Ethereum keys and converting between different formats. It is almost affected by the NIH-syndrome, but it aims to be really small and only address generation & conversion.

While doing so I've added support for MyEtherWallet (ethereumjs-accounts) keys. See the code here: https://github.com/axic/ethereumjs-wallet/blob/master/thirdparty.js#L83-L129

You might not be aware which crypto methods are used (as it is hidden in AESJS), but it is the following:

  • uses the horrible OpenSSL EVP KDF
  • uses OpenSSL salting
  • and then AES-256-CBC

The important bit I want to raise is this line:

// NOTE: yes, they've run it through UTF8
privKey = new Buffer(utf8.decode(privKey.toString()), 'hex')

It is due to .toString(CryptoJS.enc.Utf8);. I think it should have been CryptoJS.enc.Binary to not transform the seed with UTF8.

Just keep in mind changing that could produce different keys :)

cc @SilentCicero @tayvano @kvhnuke

meteor question

Hi,
I'm trying to use this via meteor. I've installed the package via meteor install silentcicero:ethereumjs-accounts, but the Accounts var isn't available as a global that I can instantiate. Should I have to do anything else?
As an aside - i'm also using the default accounts packages (for meteor login) - is it possible the 2 could clash?

Error: Could not locate the bindings file. Tried

[email protected]

var Accounts = require('ethereumjs-accounts');
var Account = new Accounts({minPassphraseLength: 6});



throw an error as below:  

/github/ganachecore/node_modules/[email protected]@bindings/bindings.js:96  throw err
  ^
Error: Could not locate the bindings file. Tried:
 → /github/ganachecore/node_modules/[email protected]@secp256k1/build/secp256k1.node
 → /github/ganachecore/node_modules/[email protected]@secp256k1/build/Debug/secp256k1.nod
e
 → /github/ganachecore/node_modules/[email protected]@secp256k1/build/Release/secp256k1.n
ode
 → /github/ganachecore/node_modules/[email protected]@secp256k1/out/Debug/secp256k1.node
 → /github/ganachecore/node_modules/[email protected]@secp256k1/Debug/secp256k1.node → /github/ganachecore/node_modules/[email protected]@secp256k1/out/Release/secp256k1.nod
e
 → /github/ganachecore/node_modules/[email protected]@secp256k1/Release/secp256k1.node
 → /github/ganachecore/node_modules/[email protected]@secp256k1/build/default/secp256k1.node
 → /github/ganachecore/node_modules/[email protected]@secp256k1/compiled/8.8.1/darwin/x64/secp256k1.node
    at bindings (/github/ganachecore/node_modules/[email protected]@bindings/bindings.js:93:9)
    at Object.<anonymous> (/github/ganachecore/node_modules/[email protected]@secp256k1/index.js:20:35)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/github/ganachecore/node_modules/[email protected]@ethereumjs-tx/ecdsaOps.js:1:77)


This or that?

You mention in the readme to use lightwallet, but in build/index.html lightwallet seems to be using your Accounts class (which seems to be shoved into their app.js). Can you explain this?

npm ERR! [email protected] install: `node-gyp rebuild`

I'm unable to install this library:

➜  ~ git:(master)  npm install ethereumjs-accounts

> [email protected] install /home/attila/node_modules/secp256k1
> node-gyp rebuild

make: Entering directory '/home/attila/node_modules/secp256k1/build'
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
In file included from ../node_modules/nan/nan.h:111:0,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Handle<v8::Integer>) [with T = v8::Int32; v8::Handle<v8::Integer> = v8::Local<v8::Integer>]’:
../node_modules/nan/nan_new.h:34:64: error: no matching function for call to ‘v8::Integer::ToInt32()’
 To<v8::Int32>(v8::Handle<v8::Integer> i)   { return i->ToInt32(); }
                                                                ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2402:43: note: candidate: v8::MaybeLocal<v8::Int32> v8::Value::ToInt32(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Int32> ToInt32(Local<Context> context) const;
                                           ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2402:43: note:   candidate expects 1 argument, 0 provided
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2415:34: note: candidate: v8::Local<v8::Int32> v8::Value::ToInt32(v8::Isolate*) const
                     Local<Int32> ToInt32(Isolate* isolate) const);
                                  ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:346:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2415:34: note:   candidate expects 1 argument, 0 provided
                     Local<Int32> ToInt32(Isolate* isolate) const);
                                  ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:346:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
In file included from ../node_modules/nan/nan.h:111:0,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Handle<v8::Integer>) [with T = v8::Uint32; v8::Handle<v8::Integer> = v8::Local<v8::Integer>]’:
../node_modules/nan/nan_new.h:39:65: error: no matching function for call to ‘v8::Integer::ToUint32()’
 To<v8::Uint32>(v8::Handle<v8::Integer> i)  { return i->ToUint32(); }
                                                                 ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2400:44: note: candidate: v8::MaybeLocal<v8::Uint32> v8::Value::ToUint32(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Uint32> ToUint32(
                                            ^~~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2400:44: note:   candidate expects 1 argument, 0 provided
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../node_modules/nan/nan_implementation_12_inl.h:49:38: error: no matching function for call to ‘v8::BooleanObject::New(bool&)’
   return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                      ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:4942:23: note: candidate: static v8::Local<v8::Value> v8::BooleanObject::New(v8::Isolate*, bool)
   static Local<Value> New(Isolate* isolate, bool value);
                       ^~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:4942:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h:49:60: error: expected primary-expression before ‘>’ token
   return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                                            ^
../node_modules/nan/nan_implementation_12_inl.h:49:62: error: expected primary-expression before ‘)’ token
   return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                                              ^
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::RegExp>::return_t Nan::imp::Factory<v8::RegExp>::New(v8::Handle<v8::String>, v8::RegExp::Flags)’:
../node_modules/nan/nan_implementation_12_inl.h:158:40: warning: ‘static v8::Local<v8::RegExp> v8::RegExp::New(v8::Local<v8::String>, v8::RegExp::Flags)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   return v8::RegExp::New(pattern, flags);
                                        ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:5015:38: note: declared here
                        Local<RegExp> New(Local<String> pattern, Flags flags));
                                      ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Script>::return_t Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>)’:
../node_modules/nan/nan_implementation_12_inl.h:166:69: error: no matching function for call to ‘v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*)’
   return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                                                                     ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::StreamedSource*, v8::Local<v8::String>, const v8::ScriptOrigin&)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note:   candidate expects 4 arguments, 2 provided
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Script>::return_t Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../node_modules/nan/nan_implementation_12_inl.h:173:69: error: no matching function for call to ‘v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*)’
   return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                                                                     ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::StreamedSource*, v8::Local<v8::String>, const v8::ScriptOrigin&)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note:   candidate expects 4 arguments, 2 provided
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::String>::return_t Nan::imp::Factory<v8::String>::New(const uint8_t*, int)’:
../node_modules/nan/nan_implementation_12_inl.h:206:42: error: no matching function for call to ‘v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*&, v8::String::NewStringType, int&)’
         v8::String::kNormalString, length);
                                          ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2760:51: note: candidate: static v8::MaybeLocal<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::NewStringType, int)
   static V8_WARN_UNUSED_RESULT MaybeLocal<String> NewFromOneByte(
                                                   ^~~~~~~~~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2760:51: note:   no known conversion for argument 3 from ‘v8::String::NewStringType’ to ‘v8::NewStringType’
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::String>::return_t Nan::imp::Factory<v8::String>::New(v8::String::ExternalStringResource*)’:
../node_modules/nan/nan_implementation_12_inl.h:217:66: error: no matching function for call to ‘v8::String::NewExternal(v8::Isolate*, v8::String::ExternalStringResource*&)’
   return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
                                                                  ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2815:21: note: candidate: static v8::Local<v8::String> v8::String::NewExternal(v8::Isolate*, v8::String::ExternalOneByteStringResource*)
       Local<String> NewExternal(Isolate* isolate,
                     ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:346:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2815:21: note:   no known conversion for argument 2 from ‘v8::String::ExternalStringResource*’ to ‘v8::String::ExternalOneByteStringResource*’
       Local<String> NewExternal(Isolate* isolate,
                     ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:346:48: note: in definition of macro ‘V8_DEPRECATE_SOON’
 #define V8_DEPRECATE_SOON(message, declarator) declarator
                                                ^~~~~~~~~~
In file included from ../node_modules/nan/nan_new.h:191:0,
                 from ../node_modules/nan/nan.h:111,
                 from ../secp256k1.cc:1:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::UnboundScript>::return_t Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>)’:
../node_modules/nan/nan_implementation_12_inl.h:237:30: error: ‘CompileUnbound’ is not a member of ‘v8::ScriptCompiler’
   return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                              ^~~~~~~~~~~~~~
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::UnboundScript>::return_t Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../node_modules/nan/nan_implementation_12_inl.h:244:30: error: ‘CompileUnbound’ is not a member of ‘v8::ScriptCompiler’
   return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                              ^~~~~~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^~~~~~~~~~~~~~
../node_modules/nan/nan.h: In function ‘bool NanIdleNotification(int)’:
../node_modules/nan/nan.h:374:39: error: ‘class v8::Isolate’ has no member named ‘IdleNotification’; did you mean ‘IdleNotificationDeadline’?
     return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms);
                                       ^~~~~~~~~~~~~~~~
                                       IdleNotificationDeadline
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:560:20: error: variable or field ‘NanAddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:560:20: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
../node_modules/nan/nan.h:561:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:566:20: error: variable or field ‘NanRemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:566:20: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
../node_modules/nan/nan.h:571:20: error: variable or field ‘NanAddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:571:20: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
../node_modules/nan/nan.h:572:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^~~~~~~~~~~~~~
../node_modules/nan/nan.h:577:20: error: variable or field ‘NanRemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:577:20: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
../node_modules/nan/nan.h:659:15: error: ‘WeakCallbackData’ in namespace ‘v8’ does not name a template type
     const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
               ^~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:659:31: error: expected ‘,’ or ‘...’ before ‘<’ token
     const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
                               ^
../node_modules/nan/nan.h: In function ‘void _NanWeakCallbackDispatcher(int)’:
../node_modules/nan/nan.h:660:42: error: ‘data’ was not declared in this scope
       _NanWeakCallbackInfo<T, P> *info = data.GetParameter();
                                          ^~~~
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^~~~~~~
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^~~~~~~~
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^~~~~~~~
../node_modules/nan/nan.h:761:50: note: suggested alternative: ‘calloc’
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^~~~~~~~
                                                  calloc
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^~~~
../node_modules/nan/nan.h:761:60: note: suggested alternative: ‘uint’
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^~~~
                                                            uint
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/node_buffer.h:66:40: note:   initializing argument 2 of ‘v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t)’
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h:768:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((char*)data), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
            ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
            ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:26: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
                          ^~~
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Script> NanCompileScript(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../node_modules/nan/nan.h:806:74: error: no matching function for call to ‘v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*)’
     return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                                                                          ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::StreamedSource*, v8::Local<v8::String>, const v8::ScriptOrigin&)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note:   candidate expects 4 arguments, 2 provided
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Script> NanCompileScript(v8::Local<v8::String>)’:
../node_modules/nan/nan.h:813:74: error: no matching function for call to ‘v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*)’
     return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                                                                          ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/node.h:63:0,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1491:51: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note: candidate: static v8::MaybeLocal<v8::Script> v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::StreamedSource*, v8::Local<v8::String>, const v8::ScriptOrigin&)
   static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
                                                   ^~~~~~~
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1518:51: note:   candidate expects 4 arguments, 2 provided
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> NanRunScript(v8::Handle<v8::UnboundScript>)’:
../node_modules/nan/nan.h:819:48: warning: ‘v8::Local<v8::Value> v8::Script::Run()’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return script->BindToCurrentContext()->Run();
                                                ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1252:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Run());
                                                   ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> NanRunScript(v8::Handle<v8::Script>)’:
../node_modules/nan/nan.h:825:24: warning: ‘v8::Local<v8::Value> v8::Script::Run()’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return script->Run();
                        ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:1252:51: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Value> Run());
                                                   ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> NanMakeCallback(v8::Handle<v8::Object>, v8::Handle<v8::Function>, int, v8::Handle<v8::Value>*)’:
../node_modules/nan/nan.h:834:60: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, func, argc, argv));
                                                            ^
In file included from ../node_modules/nan/nan.h:24:0,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/attila/.node-gyp/10.4.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> NanMakeCallback(v8::Handle<v8::Object>, v8::Handle<v8::String>, int, v8::Handle<v8::Value>*)’:
../node_modules/nan/nan.h:843:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, symbol, argc, argv));
                                                              ^
In file included from ../node_modules/nan/nan.h:24:0,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/node.h:165:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/attila/.node-gyp/10.4.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> NanMakeCallback(v8::Handle<v8::Object>, const char*, int, v8::Handle<v8::Value>*)’:
../node_modules/nan/nan.h:852:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, method, argc, argv));
                                                              ^
In file included from ../node_modules/nan/nan.h:24:0,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/node.h:158:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/attila/.node-gyp/10.4.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> NanCallback::Call_(v8::Isolate*, v8::Handle<v8::Object>, int, v8::Handle<v8::Value>*) const’:
../node_modules/nan/nan.h:1696:5: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
     )));
     ^
../node_modules/nan/nan.h:483:68: note: in definition of macro ‘NanEscapeScope’
 # define NanEscapeScope(val) scope.Escape(Nan::imp::NanEnsureLocal(val))
                                                                    ^~~
In file included from ../node_modules/nan/nan.h:24:0,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/node.h:172:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/attila/.node-gyp/10.4.0/include/node/node.h:88:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h: In function ‘void* _NanRawString(v8::Handle<v8::Value>, Nan::Encoding, size_t*, void*, size_t, int)’:
../node_modules/nan/nan.h:2316:38: warning: ‘v8::String::Value::Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
         v8::String::Value value(toStr);
                                      ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2870:51: note: declared here
     V8_DEPRECATED("Use Isolate version", explicit Value(Local<v8::Value> obj));
                                                   ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h:2350:38: warning: ‘v8::String::Value::Value(v8::Local<v8::Value>)’ is deprecated: Use Isolate version [-Wdeprecated-declarations]
         v8::String::Value value(toStr);
                                      ^
In file included from /home/attila/.node-gyp/10.4.0/include/node/v8.h:26:0,
                 from /home/attila/.node-gyp/10.4.0/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:24,
                 from ../secp256k1.cc:1:
/home/attila/.node-gyp/10.4.0/include/node/v8.h:2870:51: note: declared here
     V8_DEPRECATED("Use Isolate version", explicit Value(Local<v8::Value> obj));
                                                   ^
/home/attila/.node-gyp/10.4.0/include/node/v8config.h:324:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
secp256k1.target.mk:128: recipe for target 'Release/obj.target/secp256k1/secp256k1.o' failed
make: *** [Release/obj.target/secp256k1/secp256k1.o] Error 1
make: Leaving directory '/home/attila/node_modules/secp256k1/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-22-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/attila/node_modules/secp256k1
gyp ERR! node -v v10.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/home/attila/package.json'
npm WARN attila No description
npm WARN attila No repository field.
npm WARN attila No README data
npm WARN attila No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/attila/.npm/_logs/2018-06-12T22_39_03_429Z-debug.log

npm install fails

This is the log output, any help would be appreciated:

$ sudo npm install ethereumjs-accounts

> [email protected] install /home/someone/ethereum/node_modules/secp256k1
> node-gyp rebuild

make: Entering directory '/home/someone/ethereum/node_modules/secp256k1/build'
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:319:17: note: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../node_modules/nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../node_modules/nan/nan.h:334:27: note: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../node_modules/nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../node_modules/nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../node_modules/nan/nan.h:768:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../secp256k1.cc:1:
/home/someone/.node-gyp/4.2.6/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/someone/.node-gyp/4.2.6/include/node/node_buffer.h:31:40: note:   conversion of argument 3 would be ill-formed:
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h:768:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../node_modules/nan/nan.h:25:0,
                 from ../secp256k1.cc:1:
/home/someone/.node-gyp/4.2.6/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/home/someone/.node-gyp/4.2.6/include/node/node_buffer.h:43:40: note:   conversion of argument 2 would be ill-formed:
In file included from ../secp256k1.cc:1:0:
../node_modules/nan/nan.h:768:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../node_modules/nan/nan.h:772:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                             ^
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../node_modules/nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
secp256k1.target.mk:125: recipe for target 'Release/obj.target/secp256k1/secp256k1.o' failed
make: *** [Release/obj.target/secp256k1/secp256k1.o] Error 1
make: Leaving directory '/home/someone/ethereum/node_modules/secp256k1/build'
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:276: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 Linux 4.2.0-27-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/someone/ethereum/node_modules/secp256k1
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok 
/home/someone/ethereum
└── [email protected] 

npm WARN enoent ENOENT: no such file or directory, open '/home/someone/ethereum/package.json'
npm WARN ethereum No description
npm WARN ethereum No repository field.
npm WARN ethereum No README data
npm WARN ethereum No license field.
npm ERR! Linux 4.2.0-27-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install" "ethereumjs-accounts"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.3
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! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 information on how to open an issue for this project with:
npm ERR!     npm bugs secp256k1
npm ERR! Or if that isn't available, 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!     /home/someone/ethereum/npm-debug.log

account.encrypted never gets set to false

Pre-emptively decrypting an account in order to sign a transaction does nothing to remove the passphrase popup, as only "locked" gets set to false and the code checks "encrypted" to see if it should show the popup. Intentional?
I'm almost certainly missing something here. Closing this until I have a better understanding of what's going on.

Import from Geth

Would it be possible to import keys from Geth? They have a different Json structure from the one this library expects.

Gas price too low for acceptance

When making signTransaction for transaction like that:

{ from: '0xc40e6bd934b31b312bfe55441fc086b19aa4df4d', 
 to: '0x2ada84514b9955a7c1770bf718d1fbe49e770462',
data: '...' 
nonce: '0x0' }

getting error Gas price too low for acceptance.
So here is the question, how to process correctly transactions without specified gasPrice in txParams

package.json is sourcing browsify version to nodemoduels

Hey guys, here is the problem.

$ node server.js
/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/node_modules/localstorejs/index.js:127
            var value = localStorage.getItem(key),
                        ^
ReferenceError: localStorage is not defined
    at Object.module.exports.get (/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/node_modules/localstorejs/index.js:127:16)
    at new module.exports (/Users/phani/new_work/test/webogram/node_modules/ethereumjs-accounts/index.js:78:31)
    at Object.<anonymous> (/Users/phani/new_work/test/webogram/server.js:255:16)

Kind regards,
Phani.

"account is locked" error

Hello,

I'm trying to interact with an ethereum node on a private chain/network through RPC.
I do not understand the purpose of this library: I can create accounts, but AFAIK they cannot be used since they need to be "unlocked".

If I do this;

var greeterInstance = greeterContract.new(
    _greeting,
    {
        from : accountObject.address,
        data : greeter.contracts.greeter.bin,
        gas : 300000
    },
    (error, contract) => { // ...

I get the following error:

Account does not exist or account balance too low

I have the exact same error when I use the provided manager.html example.

So I tried sending some ether from my coinbase first :

web3.eth.sendTransaction(
    {from:web3.eth.coinbase, to:accountObject.address, value:web3.toWei(0.05, "ether")},
    (error, result) => {
        console.log(error, result);
    }
);

But error is always 0 and result is always the 0 hash so I'm guessing the transaction failed.

If I do the same operation with the provided manager.html example, I get the following message:

The transaction went through succesfully, hash: 0x0000000000000000000000000000000000000000000000000000000000000000

When the server is running geth, I don't get any specific message. Not even about the transaction.
When the server is running 'testrpc`, I get an "invalid address" error in the client javascript console and on the server:

127.0.0.1 - - [28/Jan/2016 23:06:27] "POST / HTTP/1.1" 200 -
eth_getTransactionReceipt

What am I doing wrong?

Some docs about how to make 1st transaction to an account created with ethereumjs-account would be nice.

Thank you for your help.

Regards,

problem for installing the lib from npm

Installing etherumjs-accounts give me such issue log shown as below

> [email protected] install /home/sizhexi/parking/eth/ngx-admin-master/node_modules/ethereumjs-accounts/node_modules/secp256k1
> node-gyp rebuild

make: Entering directory `/home/sizhexi/parking/eth/ngx-admin-master/node_modules/ethereumjs-accounts/node_modules/secp256k1/build'
  CXX(target) Release/obj.target/secp256k1/secp256k1.o
cc1plus: warning: command line option ‘-std=c11’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from ../../nan/nan.h:111:0,
                 from ../secp256k1.cc:1:
../../nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Handle<v8::Integer>) [with T = v8::Int32; v8::Handle<v8::Integer> = v8::Local<v8::Integer>]’:
../../nan/nan_new.h:34:64: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:9614): Use maybe version [-Wdeprecated-declarations]
 To<v8::Int32>(v8::Handle<v8::Integer> i)   { return i->ToInt32(); }
                                                                ^
../../nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Handle<v8::Integer>) [with T = v8::Uint32; v8::Handle<v8::Integer> = v8::Local<v8::Integer>]’:
../../nan/nan_new.h:39:65: warning: ‘v8::Local<v8::Uint32> v8::Value::ToUint32() const’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:9608): Use maybe version [-Wdeprecated-declarations]
 To<v8::Uint32>(v8::Handle<v8::Integer> i)  { return i->ToUint32(); }
                                                                 ^
In file included from ../../nan/nan_new.h:191:0,
                 from ../../nan/nan.h:111,
                 from ../secp256k1.cc:1:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../nan/nan_implementation_12_inl.h:49:38: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:4749): Pass an isolate [-Wdeprecated-declarations]
   return v8::BooleanObject::New(value).As<v8::BooleanObject>();
                                      ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Script>::return_t Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:166:69: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1378): Use maybe version [-Wdeprecated-declarations]
   return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                                                                     ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Script>::return_t Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../../nan/nan_implementation_12_inl.h:173:69: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1378): Use maybe version [-Wdeprecated-declarations]
   return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
                                                                     ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::String>::return_t Nan::imp::Factory<v8::String>::New(const uint8_t*, int)’:
../../nan/nan_implementation_12_inl.h:206:42: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:2624): Use maybe version [-Wdeprecated-declarations]
         v8::String::kNormalString, length);
                                          ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::String>::return_t Nan::imp::Factory<v8::String>::New(v8::String::ExternalStringResource*)’:
../../nan/nan_implementation_12_inl.h:217:66: warning: ‘static v8::Local<v8::String> v8::String::NewExternal(v8::Isolate*, v8::String::ExternalStringResource*)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:2663): Use maybe version [-Wdeprecated-declarations]
   return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
                                                                  ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::UnboundScript>::return_t Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:237:76: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1359): Use maybe version [-Wdeprecated-declarations]
   return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                                                                            ^
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::UnboundScript>::return_t Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../../nan/nan_implementation_12_inl.h:244:76: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1359): Use maybe version [-Wdeprecated-declarations]
   return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
                                                                            ^
In file included from ../secp256k1.cc:1:0:
../../nan/nan.h: At global scope:
../../nan/nan.h:324:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureHandleOrPersistent(const v8::Local<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureHandleOrPersistent(const v8::Local<T> &val) {
                           ^
../../nan/nan.h:319:17: error: ‘template<class T> v8::Handle<T> Nan::imp::NanEnsureHandleOrPersistent(v8::Handle<T>&)’ previously declared here
   v8::Handle<T> NanEnsureHandleOrPersistent(const v8::Handle<T> &val) {
                 ^
../../nan/nan.h:344:27: error: redefinition of ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(v8::Handle<T>&)’
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Handle<T> &val) {
                           ^
../../nan/nan.h:334:27: error: ‘template<class T> v8::Local<T> Nan::imp::NanEnsureLocal(const v8::Local<T>&)’ previously declared here
   NAN_INLINE v8::Local<T> NanEnsureLocal(const v8::Local<T> &val) {
                           ^
../../nan/nan.h: In function ‘bool NanIdleNotification(int)’:
../../nan/nan.h:374:71: warning: ‘bool v8::Isolate::IdleNotification(int)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:7334): use IdleNotificationDeadline() [-Wdeprecated-declarations]
     return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms);
                                                                       ^
../../nan/nan.h: At global scope:
../../nan/nan.h:560:20: error: variable or field ‘NanAddGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback
                    ^
../../nan/nan.h:560:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback
       ^
../../nan/nan.h:561:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:566:20: error: variable or field ‘NanRemoveGCEpilogueCallback’ declared void
       v8::Isolate::GCEpilogueCallback callback) {
                    ^
../../nan/nan.h:566:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCEpilogueCallback callback) {
       ^
../../nan/nan.h:571:20: error: variable or field ‘NanAddGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback
                    ^
../../nan/nan.h:571:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback
       ^
../../nan/nan.h:572:18: error: expected primary-expression before ‘gc_type_filter’
     , v8::GCType gc_type_filter = v8::kGCTypeAll) {
                  ^
../../nan/nan.h:577:20: error: variable or field ‘NanRemoveGCPrologueCallback’ declared void
       v8::Isolate::GCPrologueCallback callback) {
                    ^
../../nan/nan.h:577:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
       v8::Isolate::GCPrologueCallback callback) {
       ^
../../nan/nan.h:659:11: error: ‘WeakCallbackData’ in namespace ‘v8’ does not name a type
     const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
           ^
../../nan/nan.h:659:15: error: ISO C++ forbids declaration of ‘parameter’ with no type [-fpermissive]
     const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
               ^
../../nan/nan.h:659:31: error: expected ‘,’ or ‘...’ before ‘<’ token
     const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
                               ^
../../nan/nan.h: In function ‘void _NanWeakCallbackDispatcher(int)’:
../../nan/nan.h:660:42: error: ‘data’ was not declared in this scope
       _NanWeakCallbackInfo<T, P> *info = data.GetParameter();
                                          ^
../../nan/nan.h: At global scope:
../../nan/nan.h:757:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:757:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:761:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:761:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:768:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
In file included from ../../nan/nan.h:25:0,
                 from ../secp256k1.cc:1:
/root/.node-gyp/8.6.0/include/node/node_buffer.h:67:40: error:   initializing argument 2 of ‘v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t)’ [-fpermissive]
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
In file included from ../secp256k1.cc:1:0:
../../nan/nan.h:768:67: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((char*)data), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:772:61: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’:
../../nan/nan.h:779:12: error: ‘Use’ is not a member of ‘node::Buffer’
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../../nan/nan.h: In function ‘v8::Local<v8::Script> NanCompileScript(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../../nan/nan.h:806:74: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1378): Use maybe version [-Wdeprecated-declarations]
     return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                                                                          ^
../../nan/nan.h: In function ‘v8::Local<v8::Script> NanCompileScript(v8::Local<v8::String>)’:
../../nan/nan.h:813:74: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /root/.node-gyp/8.6.0/include/node/v8.h:1378): Use maybe version [-Wdeprecated-declarations]
     return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
                                                                          ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:769:3: warning: control reaches end of non-void function [-Wreturn-type]
   }
   ^
make: *** [Release/obj.target/secp256k1/secp256k1.o] Error 1
make: Leaving directory `/home/sizhexi/parking/eth/ngx-admin-master/node_modules/ethereumjs-accounts/node_modules/secp256k1/build'
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:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-83-generic
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 /home/sizhexi/parking/eth/ngx-admin-master/node_modules/ethereumjs-accounts/node_modules/secp256k1
gyp ERR! node -v v8.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.