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

node init.js #692

Open
Sarahshohani opened this issue Sep 30, 2021 · 26 comments
Open

node init.js #692

Sarahshohani opened this issue Sep 30, 2021 · 26 comments

Comments

@Sarahshohani
Copy link

I have get this error while performing node init.js
could you please help?
uname -a:
Linux vmi677535.contaboserver.net 4.15.0-134-generic #138-Ubuntu SMP Fri Jan 15 10:52:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I have installed node 11 ,14,16 but none of them worked I have also tried nvm but didn't worked for me.

/root/pool/node_modules/dateformat/lib/dateformat.js:1
var token=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]"|'[^']'/g;var timezone=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g;var timezoneClip=/[^-+\dA-Z]/g;export default function dateFormat(date,mask,utc,gmt){if(arguments.length===1&&typeof date==="string"&&!/\d/.test(date)){mask=date;date=undefined}date=date||date===0?date:new Date;if(!(date instanceof Date)){date=new Date(date)}if(isNaN(date)){throw TypeError("Invalid date")}mask=String(masks[mask]||mask||masks["default"]);var maskSlice=mask.slice(0,4);if(maskSlice==="UTC:"||maskSlice==="GMT:"){mask=mask.slice(4);utc=true;if(maskSlice==="GMT:"){gmt=true}}var _=function _(){return utc?"getUTC":"get"};var _d=function d(){return date_()+"Date"};var D=function D(){return date_()+"Day"};var m=function m(){return date_()+"Month"};var y=function y(){return date[()+"Full

SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/root/pool/lib/logger.js:11:18)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)

@Stardock2018
Copy link

Use node v11.15.0, I had the same problem.

@dagwood-Fenichuck
Copy link

Stardock2018 I used node v11.15.0 as you suggested but doesn't work, can you show your miner working, please

@Stardock2018
Copy link

Stardock2018 commented Oct 16, 2021 via email

@dagwood-Fenichuck
Copy link

Hi thanks for that shows great my site shows like this but just can't get buildl to run with the date format problem will try installing everything for the tenth time

@Stardock2018
Copy link

Stardock2018 commented Oct 16, 2021 via email

@dagwood-Fenichuck
Copy link

ubuntu 18.04 bionic

@Stardock2018
Copy link

did you install all the deps. ?

@maletazul
Copy link

anyone knows how to fix it ? i have some error on 18

@dagwood-Fenichuck
Copy link

Installed everything in package.json plus two peer dependencies build says were missing, do you have a screenshot of the console running the pool at the end when you node init.js

@maletazul
Copy link

maletazul commented Oct 19, 2021

Installed everything in package.json plus two peer dependencies build says were missing, do you have a screenshot of the console running the pool at the end when you node init.js

sure, here he is:
ubuntu 18
node --version
v11.15.0

[email protected]
[email protected]

node init.js
/home/luissilva/pool/node_modules/dateformat/lib/dateformat.js:26
export default function dateFormat (date, mask, utc, gmt) {
^^^^^^

SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/home/luissilva/pool/lib/logger.js:11:18)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)

or

/home/luissilva/pool/node_modules/dateformat/lib/dateformat.js:1
var token=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]"|'[^']'/g;var timezone=/\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g;var timezoneClip=/[^-+\dA-Z]/g;export default function dateFormat(date,mask,utc,gmt){if(arguments.length===1&&typeof date==="string"&&!/\d/.test(date)){mask=date;date=undefined}date=date||date===0?date:new Date;if(!(date instanceof Date)){date=new Date(date)}if(isNaN(date)){throw TypeError("Invalid date")}mask=String(masks[mask]||mask||masks["default"]);var maskSlice=mask.slice(0,4);if(maskSlice==="UTC:"||maskSlice==="GMT:"){mask=mask.slice(4);utc=true;if(maskSlice==="GMT:"){gmt=true}}var _=function _(){return utc?"getUTC":"get"};var _d=function d(){return date_()+"Date"};var D=function D(){return date_()+"Day"};var _m=function m(){return date_()+"Month"};var y=function y(){return date

SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:760:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)
at Function.Module._load (internal/modules/cjs/loader.js:620:12)
at Module.require (internal/modules/cjs/loader.js:723:19)
at require (internal/modules/cjs/helpers.js:14:16)
at Object. (/home/luissilva/pool/lib/logger.js:11:18)
at Module._compile (internal/modules/cjs/loader.js:816:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
at Module.load (internal/modules/cjs/loader.js:685:32)

@dagwood-Fenichuck
Copy link

Stardock2018 do you have a screenshot of the miner running after you node init.js sir

@maletazul
Copy link

Stardock2018 do you have a screenshot of the miner running after you node init.js sir

The pool even start for miner connections,
its a fresh install.
is that you are asking?

@dagwood-Fenichuck
Copy link

dagwood-Fenichuck commented Oct 19, 2021

Yes if you can i can't get the miner connection to start

@maletazul
Copy link

Yes if you can i can't get the miner connection to start

Like me

@Sarahshohani
Copy link
Author

Hi, thank you for your answer
did you exactly used these structures? and did you exactly used git clone https://github.com/dvandal/cryptonote-nodejs-pool.git pool

@dagwood-Fenichuck
Copy link

yes followed all instructions https://github.com/dvandal/cryptonote-nodejs-pool.git pool, but still gives dateformat error, I added ESM module, type: module to package.json changed dateformat.js to cjs and require to import and now get config undefined dont know where to go from here can anyone install this?

@TheReal420BlazeIt
Copy link

Had the same issue yesterday. Found out the npm dateformat package has some recent updates that results in the above error. For me, changing the "dateformat": "*" to "dateformat": "4.5.1" in package.json, and run npm update again, fixed the issue.

@Sarahshohani
Copy link
Author

Thank you ,
I did what you said about the dateformat and the node init.js command had worked thank you for your answer but there is just one problem that my site won't load?
www.blackberrygojiberry.com

@TheReal420BlazeIt
Copy link

That is probably because of your config.json & the website's config.js. In the pool's config.json, under the api section, you need to bind to your ip address. Leaving it on 0.0.0.0 won't work. I also had some issues when using 127.0.0.1, so use your local ip address of the server. After that, set the same ip address in the website's config.js behind the api variable.

@Sarahshohani
Copy link
Author

Thank you , I have changed my bind IP to my public ip address and even 127.0.0.1 but none of them didn't work
I've also tried to remove my ssl to see if that has problem but it didn't work too

@Sarahshohani
Copy link
Author

could you please send me your config files

@TheReal420BlazeIt
Copy link

Looks like your website's config.js is wrong. I see you use var api = "blackberrygojiberry.com:8117"; but that should be var api = "http://blackberrygojiberry.com:8117";. You have to place http or https in front of it. In your case http.

@Sarahshohani
Copy link
Author

Thank you it worked for me.

@dagwood-Fenichuck
Copy link

Thank you guys now running. have turtlecoin node in /home/user/ and pool in /var/www/pool can't connect to node daemon with pool on 127.0.0.1 or 0.0.0.0 have used my domain.com using nginx with reverse proxy. you can see its working.
error from daemon
2021-11-11 02:15:34 [api] Error getting last block data {"errno":"ECONNRESET","code":"ECONNRESET","syscall":"read"}
2021-11-11 02:15:34 [api] Stat collection finished: 1 ms redis, 25 ms daemon

API started & listening on 0.0.0.0 port 8117
2021-11-11 02:15:09 [pool] (Thread 1) Clear values for connected workers in redis database.
(node:15224) ExperimentalWarning: queueMicrotask() is experimental.
2021-11-11 02:15:09 [pool] (Thread 3) Clear values for port 3333 in redis database.
2021-11-11 02:15:09 [pool] (Thread 3) Started server listening on port 3333
2021-11-11 02:15:09 [pool] (Thread 3) Clear values for port 4444 in redis database.
2021-11-11 02:15:09 [pool] (Thread 3) Started server listening on port 4444
2021-11-11 02:15:09 [pool] (Thread 3) Clear values for port 5555 in redis database.
2021-11-11 02:15:09 [pool] (Thread 3) Started server listening on port 5555

So it's not connecting to daemon someone tell me how to connect to this turtlecoin daemon please

@88plug
Copy link

88plug commented Mar 15, 2022

Had the same issue yesterday. Found out the npm dateformat package has some recent updates that results in the above error. For me, changing the "dateformat": "*" to "dateformat": "4.5.1" in package.json, and run npm update again, fixed the issue.

Works to solve the original error!

@domajor
Copy link

domajor commented Oct 6, 2023

:~/pool$ node init.js
2023-10-06 22:08:09 [master] Starting Cryptonote Node.JS pool version v2.0.0
(node:10999) UnhandledPromiseRejectionWarning: Error: The client is closed
ubuntu 20

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

7 participants