IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.02k stars 977 forks source link

Hashtable can't build #108

Closed nammn closed 7 years ago

nammn commented 7 years ago

Running: $npm install returns with the following error:

> `> hashtable@2.0.2 install /Users/nam/Workspace/watsoniot/blockchain/marbles/node_modules/hashtable
> > node-gyp configure build
> 
>   CXX(target) Release/obj.target/native/src/hashtable.o
> In file included from ../src/hashtable.cpp:1:
> ../src/hashtable.h:7:10: fatal error: 'tr1/unordered_map' file not found
> #include <tr1/unordered_map>
>          ^
> 1 error generated.
> make: *** [Release/obj.target/native/src/hashtable.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:276:23)
> gyp ERR! stack     at emitTwo (events.js:106:13)
> gyp ERR! stack     at ChildProcess.emit (events.js:194:7)
> gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
> gyp ERR! System Darwin 
> 
> > 16.6.0`

newer osx/xcode version doesn't ship with unordered_map. Therefore compilation doesn't work. Any idea how to solve this?

Hashtable has an PR, which is sadly still open. https://github.com/chad3814/node-hashtable/pull/31

dshuffma-ibm commented 7 years ago

hmmm, I'm surprised no one else has hit this yet if its been this way for so long. I don't have a OSX system to test with either...

If we assume there is no way around the error, then I guess you could clone the hashtables repo, apply that guys PR, and then install hashtables from the file source with npm install <hashtables folder name here>

then if you run npm install, npm should see that hashtables is already installed (thus it'll skip it).

nammn commented 7 years ago

Actually I tried that. TBH my nom knowledge is limited. I did the following, as mentioned in this post: http://qiita.com/Keech/items/d866870416705b0e8e71

After that I tried to install that pr hash table globally with the option -g. Still doesn't work. Still tries to use the old hashtable. Any suggestions there?

dshuffma-ibm commented 7 years ago

hey that's pretty cool, didn't know you could do it directly from a PR.

it may be conflicting with shrinkwrap.

  1. remove the hashtable entry starting at line 1151.
  2. run your command npm install "https://github.com/fabrice102/node-hashtable.git" from marbles itself
  3. then npm install from marbles

if that still doesn't work delete the npm-shrinkwrap.json file entirely, and repeat.

nammn commented 7 years ago

Removing the line as you have mentioned worked out for me! npm install went through. Thanks!