solana-jupiter-bot icon indicating copy to clipboard operation
solana-jupiter-bot copied to clipboard

use "yarn start"show error!

Open hk8846 opened this issue 1 year ago • 15 comments

I use "yarn start",then show error: \solana-jupiter-bot-main\node_modules\yoga-layout-prebuilt\yoga-layout\build\Release\nbind.js:53 throw ex; ^

Error: Cannot find module 'rpc-websockets/dist/lib/client'

but I use "yarn" init all package in my project,please help me!!!

hk8846 avatar Jul 24 '24 08:07 hk8846

Same here. I guess the versions required in yarn.lock are out of date.

chlarsen avatar Aug 06 '24 11:08 chlarsen

any insight? @hk8846 @chlarsen

ngocbv avatar Aug 13 '24 08:08 ngocbv

Try yarn install beforehand

T1CkShot avatar Aug 24 '24 04:08 T1CkShot

Alas, this does not seem to do the trick. Tried a completely new install, tried both "yarn install" and "yarn" individually and in different order, yet no luck. Here is what I get:

$ yarn start
yarn run v1.22.22
$ node --no-deprecation ./src/index.js && node --no-deprecation ./src/bot/index.js
/home/chris/solana-jupiter-bot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Cannot find module 'rpc-websockets/dist/lib/client'
Require stack:
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/dist/index.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js
- /home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/index.js
- /home/chris/solana-jupiter-bot/src/wizard/Pages/Tokens.js
- /home/chris/solana-jupiter-bot/node_modules/import-jsx/index.js
- /home/chris/solana-jupiter-bot/src/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js:20:32)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/node_modules/@solana/web3.js/lib/index.cjs.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/common/dist/index.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js',
    '/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/index.js',
    '/home/chris/solana-jupiter-bot/src/wizard/Pages/Tokens.js',
    '/home/chris/solana-jupiter-bot/node_modules/import-jsx/index.js',
    '/home/chris/solana-jupiter-bot/src/index.js'
  ]
}

Node.js v20.17.0
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any thoughts? Thank you!

chlarsen avatar Aug 25 '24 14:08 chlarsen

https://stackoverflow.com/questions/78566652/solana-web3-js-cannot-find-module-rpc-websockets-dist-lib-client

manually downgrade rpc-websockets package to 7.11.0 by setting it in the package json

T1CkShot avatar Aug 27 '24 04:08 T1CkShot

Thank you again, @T1CkShot. I now get:

$ yarn start
yarn run v1.22.22
$ node --no-deprecation ./src/index.js && node --no-deprecation ./src/bot/index.js
/home/chris/solana-jupiter-bot/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

TypeError: Class extends value undefined is not a constructor or null
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/node_modules/@solana/web3.js/lib/index.cjs.js:4233:48)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/home/chris/solana-jupiter-bot/src/utils/index.js:7:44)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)

Node.js v20.17.0
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any ideas? A huge "Thank you!"

chlarsen avatar Aug 27 '24 11:08 chlarsen

Install whis Node 16 , and run whis Node 18

L2b2n avatar Aug 27 '24 11:08 L2b2n

Node v. 16 is too outdated, and yarn fails completely. Node v. 18 installs OK, with downgraded rpc-websockets. However the error reported by myself before is still the same.

chlarsen avatar Aug 28 '24 07:08 chlarsen

Oh sry install whis 18 and run whis 16

L2b2n avatar Aug 28 '24 10:08 L2b2n

Try this, First upgrade @solana/web3.js by yarn upgrade @solana/web3.js then remove the node modules and reinstall with yarn install Also use node 18 instead of 20 and see if it works. @chlarsen

T1CkShot avatar Aug 28 '24 12:08 T1CkShot

Thank you @T1CkShot! Here is what I did: I installed nodejs v18, which is routinely distributed with Debian bookworm:

apt install nodejs

Next I installed yarn:

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt update
apt install yarn

I then run the following as non-privileged user:

cd
git clone https://github.com/ARBProtocol/solana-jupiter-bot.git
cd ./solana-jupiter-bot
yarn install
yarn upgrade @solana/web3.js
rm -rf ./node_modules
yarn install

Note: No downgrading of rpc-websocket seems to be required. I created a suitable .env, and then issued as non-privileged user:

yarn start

I get:

             ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
      network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
          rpc┃                                                                              ┃
     strategy┃                                                                              ┃
       tokens┃  ──────────────────── network ────────────────────                           ┃
 trading size┃                                                                              ┃
       profit┃ Select Solana Network:                                                       ┃
     slippage┃                                                                              ┃
     priority┃  ❯ mainnet-beta                                                              ┃
     advanced┃                                                                              ┃
      confirm┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┃                                                                              ┃
             ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What looks like an error looks more like a feature, not a bug on a bigger screen, because there is a message hidden outside the bot's main screen, which says: "You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot." Oops, let me run down to the supermarket and get some ARB :-). I shall report back later!

chlarsen avatar Aug 29 '24 09:08 chlarsen

I added 14k ARB (token address: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) to my wallet, but the same error reappears, whenever I run 'yarn start':


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.



ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************


                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Yet, I have 14k ARB in my wallet, plus SOL for gas fees, etc. Thoughts?

chlarsen avatar Aug 29 '24 09:08 chlarsen

I added 14k ARB (token address: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) to my wallet, but the same error reappears, whenever I run 'yarn start':


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.



ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************


                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Yet, I have 14k ARB in my wallet, plus SOL for gas fees, etc. Thoughts?

delete line 217-240 from /src/utils/index.js

snurfer0 avatar Sep 02 '24 23:09 snurfer0

Thank you, the ARB issue has been sorted, the bot configured for a test run with ping pong trade, INF/USDC, 30 BPS slippage to avoid slippage errors for now, but I get:

Error: No routes found for the input and output mints
    at Vn (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js:1:177824)
    at Yn.computeRoutes (/home/chris/solana-jupiter-bot/node_modules/@jup-ag/core/dist/core.cjs.production.min.js:1:192951)
    at async pingpongStrategy (/home/chris/solana-jupiter-bot/src/bot/index.js:64:18)
    at async watcher (/home/chris/solana-jupiter-bot/src/bot/index.js:452:4)

INF and USDC are recognised by the wizard and selected via TUI dropdown. Any thoughts? Thank you! C.

chlarsen avatar Sep 03 '24 03:09 chlarsen

Ich habe 14k ARB (Token-Adresse: 4FKVLyhBAeLEvjZfWPfV4hqWAPkpjn94cRqi3raY3hy9) zu meiner Brieftasche hinzugefügt, aber derselbe Fehler tritt erneut auf, wenn ich „yarn start“ ausführe:


You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.



ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.


ARB PROTOCOL BOT SETUP TESTS

*************************

You are not ARB ready! You need to hold at least 10K in ARB in your trading wallet to use this bot.

*************************


                                            [ previous             ] next              [H]elp             [ESC]

               ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃  ▄▀█ █▀█ █▄▄    █ █ █ █▀█ █ ▀█▀ █▀▀ █▀█  █▄▄ █▀█ ▀█▀                         ┃
        network┃  █▀█ █▀▄ █▄█  █▄█ █▄█ █▀▀ █  █  ██▄ █▀▄  █▄█ █▄█  █                          ┃
            rpc┃                                                                              ┃
       strategy┃                                                                              ┃
         tokens┃  ──────────────────── network ────────────────────                           ┃
   trading size┃                                                                              ┃
         profit┃ Select Solana Network:                                                       ┃
       slippage┃                                                                              ┃
       priority┃  ❯ mainnet-beta                                                              ┃
       advanced┃                                                                              ┃
        confirm┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┃                                                                              ┃
               ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Dennoch habe ich 14.000 ARB in meiner Brieftasche, plus SOL für Gasgebühren usw. Was meint ihr?

Löschen Sie die Zeilen 217-240 aus /src/utils/index.js

@snurfer0
Hello, I have the same problem but you can't delete all of the lines 217 -240 then the export no longer works. Which lines do you have to delete for it to work?? these are the lines 217-240 for me

	return true;
} catch (err){
	console.clear(); // Clear console before displaying message
	displayMessage("You do not seem to be ARB ready!\n\nCheck the .ENV file to see your RPC is set up properly and your wallet is set to the correct private key.");
	process.exit(1);
}

};

module.exports = { createTempDir, storeItInTempAsJSON, createConfigFile, loadConfigFile, verifyConfig, calculateProfit, toDecimal, toNumber, updateIterationsPerMin, checkRoutesResponse, checkForEnvFile, checkArbReady, checkWallet, };

Krokodiler24 avatar Sep 11 '24 20:09 Krokodiler24

Did you ever get it working? I started down this rabbit hole today and hit many of the same brick walls.

xylodan avatar Oct 11 '24 21:10 xylodan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Nov 11 '24 06:11 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Nov 25 '24 06:11 github-actions[bot]