cazala / coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
http://npmjs.com/package/coin-hive-stratum
416 stars 465 forks source link

Error: Cannot find module 'coin-hive-stratum' #150

Open isaack0815 opened 6 years ago

isaack0815 commented 6 years ago

hay, when I start the proxy with pm2 I always get the following error:

0|proxy    |     at Object.Module._extensions..js (module.js:654:10)
0|proxy    |     at Module.load (module.js:556:32)
0|proxy    |     at tryModuleLoad (module.js:499:12)
0|proxy    |     at Function.Module._load (module.js:491:3)
0|proxy    | 2018-02-04 13:46: Error: Cannot find module 'coin-hive-stratum'
0|proxy    |     at Function.Module._resolveFilename (module.js:538:15)
0|proxy    |     at Function.Module._load (module.js:468:25)
0|proxy    |     at Module.require (module.js:587:17)
0|proxy    |     at require (internal/module.js:11:18)
0|proxy    |     at Object.<anonymous> (/home/server/proxy.js:1:77)
0|proxy    |     at Module._compile (module.js:643:30)
0|proxy    |     at Object.Module._extensions..js (module.js:654:10)
0|proxy    |     at Module.load (module.js:556:32)
0|proxy    |     at tryModuleLoad (module.js:499:12)
0|proxy    |     at Function.Module._load (module.js:491:3)

but I have coin-hive-stratum with the command npm i -g pm2 coin-hive-stratum installed.

I can also do the proxy with the command coin-hive-stratum 8892 - host = pool.supportxmr.com --port = 3333 start. but not with pm2

an idea of what that may be?

SiemdeNijs commented 6 years ago

I'm having the same problem on CentOS7, When I run the "coin-hive-stratum 8892 - host = pool.supportxmr.com --port = 3333" command, everything is setup correctly and working fine, but when I try to run "proxy.js" with PM2, the proxy/service doesn't seem to work at all/not online/not listening on ports/not even started, I think.

Following this. PS: Try to see if the " are correctly placed (at const Proxy = require("coin-hive-stratum"); )

PPS: Be sure to run from the coin-hive-stratum directory, this seems to help too

jimmy-tfp commented 6 years ago

you might try implementing your proxy as a regular node program, thus:

mkdir proxy cd proxy/ npm init <-- just use the defaults npm install --save coin-hive-stratum vi proxy.js <-- from the wiki node proxy.js <-- as a test pm2 start proxy.js --name=proxy --log-date-format="YYYY-MM-DD HH:mm" <-- from the wiki

d3c0d3d commented 6 years ago

Run npm install coin-hive-stratum inside the folder where 'script' is.

76