aionnetwork / aion_miner

aion miner
57 stars 25 forks source link

Can't compile the equihash verifier in aion_solo_pool #3

Closed JimVanEeden closed 6 years ago

JimVanEeden commented 6 years ago

node-gyp configure fails with the following error message:

jim@riddles:~/aion/aion_miner/aion_solo_pool/local_modules/equihashverify$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.9.3 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/jim/aion/aion_miner/aion_solo_pool/local_modules/equihashverify/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/jim/.node-gyp/8.9.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/jim/.node-gyp/8.9.3',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/jim/.node-gyp/8.9.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/jim/aion/aion_miner/aion_solo_pool/local_modules/equihashverify',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
module.js:538
    throw err;
    ^

Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at [eval]:1:1
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:635:30)
    at evalScript (bootstrap_node.js:462:27)
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.13.0-32-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/bin/node-gyp" "configure"
gyp ERR! cwd /home/jim/aion/aion_miner/aion_solo_pool/local_modules/equihashverify
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 

As far as I can see I have all the correct requirements and versions installed.

aion-Ross commented 6 years ago

Could you try navigating to the aion_solo_pool folder and running npm install?

Seems like node is missing that "nan" package on some node installs.

JimVanEeden commented 6 years ago

Great, that works. You should probably change the order of step 3 and step 4 in the docs so other people don't get the same problem.

JSorenSwanson commented 6 years ago

I'd like to add that I fixed this error by installing the legacy version of nodejs, whereas installing via npm from the root directory threw a bundledDependency error.