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

json error then enoent #18

Closed
psx365 opened this issue Nov 13, 2021 · 12 comments
Closed

json error then enoent #18

psx365 opened this issue Nov 13, 2021 · 12 comments
Assignees

Comments

@psx365
Copy link

psx365 commented Nov 13, 2021

npm run collect

travian-elephant@0.0.1 collect
node src/scripts/collectOasysPosition.js

C:\Users\Administrator\Desktop\travian-elephant-finder-master\node_modules\jsonfile\index.js:67
throw err
^

SyntaxError: data/oasis.json: Unexpected end of JSON input
at JSON.parse ()
at Object.readFileSync (C:\Users\Administrator\Desktop\travian-elephant-finder-master\node_modules\jsonfile\index.js:63:17)
at Object. (C:\Users\Administrator\Desktop\travian-elephant-finder-master\src\scripts\collectOasysPosition.js:8:30)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
PS C:\Users\Administrator\Desktop\travian-elephant-finder-master>

then if I place curly brackets inside the empty oasis.json file it runs but gives the different error below

Error: ENOENT: no such file or directory, open 'src/config/token.txt'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Object.getToken (C:\Users\Administrator\Desktop\travian-elephant-finder-master\src\config\index.js:39:20)
at Object.getBearerHeader (C:\Users\Administrator\Desktop\travian-elephant-finder-master\src\config\index.js:43:22)
at C:\Users\Administrator\Desktop\travian-elephant-finder-master\src\libs\axiosApi.js:14:27
at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:61:5)
at module.exports.runLoopOnce (C:\Users\Administrator\Desktop\travian-elephant-finder-master\node_modules\deasync\index.js:64:10)
at module.exports (C:\Users\Administrator\Desktop\travian-elephant-finder-master\node_modules\deasync-promise\index.js:13:9)
at module.exports (C:\Users\Administrator\Desktop\travian-elephant-finder-master\node_modules\system-sleep\module.js:30:36)
at Object. (C:\Users\Administrator\Desktop\travian-elephant-finder-master\src\scripts\collectOasysPosition.js:47:5) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'src/config/token.txt'
}

@Tegos Tegos self-assigned this Nov 13, 2021
@Tegos
Copy link
Owner

Tegos commented Nov 13, 2021

Hello, @psx365 . Did you follow of the instruction setup from readme ?

Setup

  • clone the repo
  • install the dependencies, yarn install
  • run npm run preinstal or npm run preinstal-windows
  • you should probably register new fake account for these manipulations.

@psx365
Copy link
Author

psx365 commented Nov 13, 2021

Yes I did. Somehow managed to get trough those errors. Btw. I had to manually make an empty token.txt file and install an older version of node.js + use the "npm install" command. But now I am getting a lot of html codes when I run npm collect.

But I don't get how the bot can login if I don't give the pw and acc name to it.
Capture

@Tegos
Copy link
Owner

Tegos commented Nov 13, 2021

What about antother step of readme? Can you provide your config files?

Config

Set correct configuration in:

  • .env file
  • src/config/cookie.txt file

But I don't get how the bot can login if I don't give the pw and acc name to it.

Application can work with correct cookie auth.

@psx365
Copy link
Author

psx365 commented Nov 13, 2021

.env.txt
cookie.txt

@Tegos
Copy link
Owner

Tegos commented Nov 13, 2021

Yes, seems there are some problems, need to check updates from game.

@Tegos
Copy link
Owner

Tegos commented Nov 13, 2021

add some fixes. reinstall app, and use yarn install, instead npm install

@Tegos
Copy link
Owner

Tegos commented Nov 14, 2021

Hello, @psx365. I'm waiting for your report :)

@Tegos
Copy link
Owner

Tegos commented Nov 14, 2021

I created an account and checked the wrork of the tool, see results.
image

https://ts8.x1.europe.travian.com/karte.php?x=37&y=-172

image

@psx365
Copy link
Author

psx365 commented Nov 15, 2021

I am going to check it today. Last time I tested after the "npm run collect" command it was frozen and did nothing.

Update: It works I get the datas that I need, but the excel files are empty.

@Tegos
Copy link
Owner

Tegos commented Nov 17, 2021

Hello, @psx365
Did you figure out with configurations? You run npm run find and get empty excel file? There are two options: you set wrong configurations or there are no elephants.

@bitschak
Copy link

bitschak commented Mar 5, 2022

Hi!
I encountered with the same issue as above. When I try to 'run collect' says the following:

PS C:\Users\user\Documents\GitHub\travian-elephant-finder> npm run collect

travian-elephant@0.0.4 collect
node src/scripts/collectOasysPosition.js

C:\Users\user\Documents\GitHub\travian-elephant-finder\node_modules\jsonfile\index.js:67
throw err
^

SyntaxError: data/oasis.json: Unexpected end of JSON input
at JSON.parse ()
at Object.readFileSync (C:\Users\User\Documents\GitHub\travian-elephant-finder\node_modules\jsonfile\index.js:63:17)
at Object. (C:\Users\User\Documents\GitHub\travian-elephant-finder\src\scripts\collectOasysPosition.js:11:30)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47

Node.js v17.6.0
PS C:\Users\user\Documents\GitHub\travian-elephant-finder>

How did you resolve the problem? Thanks!

@Tegos
Copy link
Owner

Tegos commented Aug 8, 2022

Hello @bitschak . It is a stale issue. Create a new issue if the error still exists.

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

3 participants