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

Can't Install Latest Version? #29

Closed
rdegges opened this issue Feb 26, 2016 · 5 comments
Closed

Can't Install Latest Version? #29

rdegges opened this issue Feb 26, 2016 · 5 comments

Comments

@rdegges
Copy link
Contributor

rdegges commented Feb 26, 2016

Steps to reproduce

  1. Install the latest version of node-gyp globally.
  2. Use Node 4.0.0+
  3. Attempt to install this module via npm: npm install argon2 --save in a project.

Expected behaviour

The module should be installed without issue.

Actual behaviour

The module fails to build with node-gyp:

npm install argon2 --save

> argon2@0.9.0 install /Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2
> node-gyp rebuild

  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  LIBTOOL-STATIC Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
In file included from ../src/argon2_node.cpp:8:
../src/argon2_node.h:28:10: error: no type named 'unique_ptr' in namespace 'std'
    std::unique_ptr<char[]> output;
    ~~~~~^
../src/argon2_node.h:28:20: error: expected member name or ';' after declaration specifiers
    std::unique_ptr<char[]> output;
    ~~~~~~~~~~~~~~~^
../src/argon2_node.cpp:22:16: error: no member named 'ceil' in namespace 'std'
    using std::ceil;
          ~~~~~^
../src/argon2_node.cpp:24:35: error: use of undeclared identifier 'ceil'
    return static_cast<size_type>(ceil(length / 3.0)) * 4;
                                  ^
../src/argon2_node.cpp:20:21: error: no return statement in constexpr function
constexpr size_type base64Length(size_type length)
                    ^
../src/argon2_node.cpp:30:16: error: no member named 'to_string' in namespace 'std'
    using std::to_string;
          ~~~~~^
../src/argon2_node.cpp:34:32: error: use of undeclared identifier 'to_string'
            memoryCostLength = to_string(log(ARGON2_MAX_MEMORY)).size(),
                               ^
../src/argon2_node.cpp:35:30: error: use of undeclared identifier 'to_string'
            timeCostLength = to_string(ARGON2_MAX_TIME).size(),
                             ^
../src/argon2_node.cpp:36:33: error: use of undeclared identifier 'to_string'
            parallelismLength = to_string(ARGON2_MAX_LANES).size();
                                ^
../src/argon2_node.cpp:47:69: error: member initializer 'output' does not name a non-static data member or base class
    memory_cost{memory_cost}, parallelism{parallelism}, type{type}, output{}
                                                                    ^~~~~~~~
../src/argon2_node.cpp:53:5: error: use of undeclared identifier 'output'
    output.reset(new char[ENCODED_LEN]);
    ^
../src/argon2_node.cpp:57:23: error: use of undeclared identifier 'output'
            HASH_LEN, output.get(), ENCODED_LEN, type);
                      ^
../src/argon2_node.cpp:74:34: error: use of undeclared identifier 'output'
    promise->Resolve(Nan::Encode(output.get(), strlen(output.get())));
                                 ^
../src/argon2_node.cpp:74:55: error: use of undeclared identifier 'output'
    promise->Resolve(Nan::Encode(output.get(), strlen(output.get())));
                                                      ^
../src/argon2_node.cpp:141:24: error: no member named 'unique_ptr' in namespace 'std'
    auto output = std::unique_ptr<char[]>{new char[ENCODED_LEN]};
                  ~~~~~^
../src/argon2_node.cpp:141:39: error: expected '(' for function-style cast or type construction
    auto output = std::unique_ptr<char[]>{new char[ENCODED_LEN]};
                                  ~~~~^
../src/argon2_node.cpp:251:34: warning: implicit conversion from 'unsigned long long' to 'uint32_t' (aka 'unsigned int') changes value from 4294967296 to 0 [-Wconstant-conversion]
            Nan::New<Number>(log(ARGON2_MAX_MEMORY)));
                             ~~~ ^~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:58:50: note: expanded from macro 'ARGON2_MAX_MEMORY'
    ARGON2_MIN(UINT32_C(0xFFFFFFFF), UINT64_C(1) << ARGON2_MAX_MEMORY_BITS)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/../argon2/include/argon2.h:53:46: note: expanded from macro 'ARGON2_MIN'
#define ARGON2_MIN(a, b) ((a) < (b) ? (a) : (b))
                                             ^
1 warning and 16 errors generated.
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/rdegges/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.3.0
gyp ERR! command "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/node" "/Users/rdegges/.nvm/versions/node/v5.5.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/rdegges/Dropbox/Code/testing/argon/node_modules/argon2
gyp ERR! node -v v5.5.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN EPACKAGEJSON argon@1.0.0 No description
npm WARN EPACKAGEJSON argon@1.0.0 No repository field.
npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/node" "/Users/rdegges/.nvm/versions/node/v5.5.0/bin/npm" "install" "argon2" "--save"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE

npm ERR! argon2@0.9.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the argon2@0.9.0 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 argon2 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 argon2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/rdegges/Dropbox/Code/testing/argon/npm-debug.log

Environment

Operating system: OSX

Node version: 5.5.0

Compiler version:

@ranisalt
Copy link
Owner

Compiler version:

You probably do not have the required compiler version. You'll either need gcc 4.8+ or clang 3.3+ (better bet since you're on OSX).

I'm trying to configure Travis to build with OSX too so those errors will be prevented.

@rdegges
Copy link
Contributor Author

rdegges commented Feb 26, 2016

Thanks! I'm not terribly familiar with this :(

I just went ahead and made sure I had all the latest xcode stuff, which I do, but that's apparently not enough to build this any longer.

I did some research, and was able to get gcc 5.3.0 installed via homebrew, by doing:

$ brew install gcc

But -- this only gives you a gcc-5 binary, so building this library still fails with errors since it's using the gcc binary and not gcc-5 (which isn't anyone's fault, except brew maybe =p).

I don't suppose you know of a good way to get either GCC / Clang installed on OSX to make things work? It might also be worth it to mention the compiler dependencies in the readme.

@ranisalt
Copy link
Owner

You can use env CXX=g++-5 npm install instead which will select g++-5 as the compiler for C++ (CXX). Change accordingly if g++ is not called g++, sometimes it's gcc-c++

@rdegges
Copy link
Contributor Author

rdegges commented Feb 26, 2016

That worked perfectly, thank you!

Want a PR to include some of this in the README? I'd be happy to submit, although I'm not terribly familiar with all the different options / etc., so not sure if you want me to take a stab at it or not ^^

@ranisalt
Copy link
Owner

Please do, I'm currently trying to fix #25 so I'm focused. I'll comment if there's anything out of order :P

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

2 participants