dappuniversity / price-bot

397 stars 392 forks source link

Not working #41

Open xplorer990 opened 1 year ago

xplorer990 commented 1 year ago

''npm install'' gives the following.

`C:\Users\username\Documents\Dapp\price-bot

Mode LastWriteTime Length Name


-a--- 7/22/2022 3:08 AM 91 .env.example -a--- 7/22/2022 3:08 AM 100 .gitignore -a--- 7/22/2022 3:08 AM 21756 index.js -a--- 7/22/2022 3:08 AM 203037 package-lock.json -a--- 7/22/2022 3:08 AM 691 package.json

PS C:\Users\username\Documents\Dapp\price-bot> npm install npm WARN config global --global, --local are deprecated. Use --location=global instead. npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN old lockfile Error: git dep preparation failed npm WARN old lockfile at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27) npm WARN old lockfile at ChildProcess.emit (node:events:527:28) npm WARN old lockfile at maybeClose (node:internal/child_process:1092:16) npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm WARN old lockfile Could not fetch metadata for web3-provider-engine@git+ssh://git@github.com/trufflesuite/provider-engine.git#3538c60bc4836b73ccae1ac3f64c8fed8ef19c1a Error: git dep preparation failed npm WARN old lockfile at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27) npm WARN old lockfile at ChildProcess.emit (node:events:527:28) npm WARN old lockfile at maybeClose (node:internal/child_process:1092:16) npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm WARN old lockfile cmd: 'C:\Program Files\nodejs\node.exe', npm WARN old lockfile args: [ npm WARN old lockfile 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', npm WARN old lockfile 'install', npm WARN old lockfile '--force', npm WARN old lockfile '--cache=C:\Users\username\AppData\Local\npm-cache', npm WARN old lockfile '--prefer-offline=false', npm WARN old lockfile '--prefer-online=false', npm WARN old lockfile '--offline=false', npm WARN old lockfile '--no-progress', npm WARN old lockfile '--no-save', npm WARN old lockfile '--no-audit', npm WARN old lockfile '--include=dev', npm WARN old lockfile '--include=peer', npm WARN old lockfile '--include=optional', npm WARN old lockfile '--no-package-lock-only', npm WARN old lockfile '--no-dry-run' npm WARN old lockfile ], npm WARN old lockfile code: 1, npm WARN old lockfile signal: null, npm WARN old lockfile stdout: '\n' + npm WARN old lockfile '> web3-provider-engine@14.0.6 prepublish\n' + npm WARN old lockfile '> npm run build && npm run bundle\n' + npm WARN old lockfile '\n' + npm WARN old lockfile '\n' + npm WARN old lockfile '> web3-provider-engine@14.0.6 build\n' + npm WARN old lockfile '> babel zero.js index.js -d dist/es5 && babel subproviders -d dist/es5/subproviders && babel util -d dist/es5/util\n' + npm WARN old lockfile '\n' + npm WARN old lockfile 'zero.js -> dist\es5\zero.js\n' + npm WARN old lockfile 'index.js -> dist\es5\index.js\n' + npm WARN old lockfile 'subproviders\cache.js -> dist\es5\subproviders\cache.js\n' + npm WARN old lockfile 'subproviders\default-fixture.js -> dist\es5\subproviders\default-fixture.js\n' + npm WARN old lockfile 'subproviders\etherscan.js -> dist\es5\subproviders\etherscan.js\n' + npm WARN old lockfile 'subproviders\fetch.js -> dist\es5\subproviders\fetch.js\n' + npm WARN old lockfile 'subproviders\filters.js -> dist\es5\subproviders\filters.js\n' + npm WARN old lockfile 'subproviders\fixture.js -> dist\es5\subproviders\fixture.js\n' + npm WARN old lockfile 'subproviders\gasprice.js -> dist\es5\subproviders\gasprice.js\n' + npm WARN old lockfile 'subproviders\hooked-wallet-ethtx.js -> dist\es5\subproviders\hooked-wallet-ethtx.js\n' + npm WARN old lockfile 'subproviders\hooked-wallet.js -> dist\es5\subproviders\hooked-wallet.js\n' + npm WARN old lockfile 'subproviders\inflight-cache.js -> dist\es5\subproviders\inflight-cache.js\n' + npm WARN old lockfile 'subproviders\infura.js -> dist\es5\subproviders\infura.js\n' + npm WARN old lockfile 'subproviders\ipc.js -> dist\es5\subproviders\ipc.js\n' + npm WARN old lockfile 'subproviders\nonce-tracker.js -> dist\es5\subproviders\nonce-tracker.js\n' + npm WARN old lockfile 'subproviders\provider.js -> dist\es5\subproviders\provider.js\n' + npm WARN old lockfile 'subproviders\rpc.js -> dist\es5\subproviders\rpc.js\n' + npm WARN old lockfile 'subproviders\sanitizer.js -> dist\es5\subproviders\sanitizer.js\n' + npm WARN old lockfile 'subproviders\stream.js -> dist\es5\subproviders\stream.js\n' + npm WARN old lockfile 'subproviders\subprovider.js -> dist\es5\subproviders\subprovider.js\n' + npm WARN old lockfile 'subproviders\subscriptions.js -> dist\es5\subproviders\subscriptions.js\n' + npm WARN old lockfile 'subproviders\vm.js -> dist\es5\subproviders\vm.js\n' + npm WARN old lockfile 'subproviders\wallet.js -> dist\es5\subproviders\wallet.js\n' + npm WARN old lockfile 'subproviders\websocket.js -> dist\es5\subproviders\websocket.js\n' + npm WARN old lockfile 'subproviders\whitelist.js -> dist\es5\subproviders\whitelist.js\n' + npm WARN old lockfile 'util\assert.js -> dist\es5\util\assert.js\n' + npm WARN old lockfile 'util\async.js -> dist\es5\util\async.js\n' + npm WARN old lockfile 'util\create-payload.js -> dist\es5\util\create-payload.js\n' + npm WARN old lockfile 'util\estimate-gas.js -> dist\es5\util\estimate-gas.js\n' + npm WARN old lockfile 'util\random-id.js -> dist\es5\util\random-id.js\n' + npm WARN old lockfile 'util\rpc-cache-utils.js -> dist\es5\util\rpc-cache-utils.js\n' + npm WARN old lockfile 'util\rpc-hex-encoding.js -> dist\es5\util\rpc-hex-encoding.js\n' + npm WARN old lockfile 'util\stoplight.js -> dist\es5\util\stoplight.js\n' + npm WARN old lockfile '\n' + npm WARN old lockfile '> web3-provider-engine@14.0.6 bundle\n' + npm WARN old lockfile '> mkdir -p ./dist && npm run bundle-engine && npm run bundle-zero\n' + npm WARN old lockfile '\n', npm WARN old lockfile stderr: 'npm WARN using --force Recommended protections disabled.\n' + npm WARN old lockfile 'npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated\n' + npm WARN old lockfile 'npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated\n' + npm WARN old lockfile 'npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated\n' + npm WARN old lockfile 'npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated\n' + npm WARN old lockfile 'npm WARN deprecated har-validator@5.1.5: this library is no longer supported\n' + npm WARN old lockfile 'npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter\n' + npm WARN old lockfile 'npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.\n' + npm WARN old lockfile 'npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!\n' + npm WARN old lockfile 'npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n' + npm WARN old lockfile "npm WARN deprecated eth-sig-util@1.4.2: Deprecated in favor of '@metamask/eth-sig-util'\n" + npm WARN old lockfile 'npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-common@1.5.2: New package name format for new versions: @ethereumjs/common. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.\n' + npm WARN old lockfile 'npm WARN config global --global, --local are deprecated. Use --location=global instead.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' + npm WARN old lockfile 'npm WARN config global --global, --local are deprecated. Use --location=global instead.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabled.\n' + npm WARN old lockfile 'The syntax of the command is incorrect.\r\n' + npm WARN old lockfile 'npm ERR! code 1\n' + npm WARN old lockfile 'npm ERR! path C:\Users\username\AppData\Local\npm-cache\_cacache\tmp\git-cloneg5Urm9\n' + npm WARN old lockfile 'npm ERR! command failed\n' + npm WARN old lockfile 'npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build && npm run bundle\n' + npm WARN old lockfile '\n' + npm WARN old lockfile 'npm ERR! A complete log of this run can be found in:\n' + npm WARN old lockfile 'npm ERR! C:\Users\username\AppData\Local\npm-cache\_logs\2022-07-22T01_36_51_845Z-debug-0.log\n' npm WARN old lockfile } npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'trading-bot@0.3.0', npm WARN EBADENGINE required: { node: '10.x' }, npm WARN EBADENGINE current: { node: 'v16.16.0', npm: '8.11.0' } npm WARN EBADENGINE } npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update. npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that. npm WARN deprecated har-validator@5.1.3: this library is no longer supported npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated eth-sig-util@1.4.2: Deprecated in favor of '@metamask/eth-sig-util' npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update. npm WARN deprecated uuid@2.0.1: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update. npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update. npm WARN deprecated axios@0.19.2: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 npm WARN deprecated ethereumjs-common@1.5.1: New package name format for new versions: @ethereumjs/common. Please update. npm WARN deprecated core-js@2.6.11: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm notice npm notice New minor version of npm available! 8.11.0 -> 8.15.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.15.0 npm notice Run npm install -g npm@8.15.0 to update! npm notice npm ERR! code 1 npm ERR! git dep preparation failed npm ERR! command C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js install --force --cache=C:\Users\username\AppData\Local\npm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run npm ERR! > web3-provider-engine@14.0.6 prepublish npm ERR! > npm run build && npm run bundle npm ERR! npm ERR! npm ERR! > web3-provider-engine@14.0.6 build npm ERR! > babel zero.js index.js -d dist/es5 && babel subproviders -d dist/es5/subproviders && babel util -d dist/es5/util npm ERR! npm ERR! zero.js -> dist\es5\zero.js npm ERR! index.js -> dist\es5\index.js npm ERR! subproviders\cache.js -> dist\es5\subproviders\cache.js npm ERR! subproviders\default-fixture.js -> dist\es5\subproviders\default-fixture.js npm ERR! subproviders\etherscan.js -> dist\es5\subproviders\etherscan.js npm ERR! subproviders\fetch.js -> dist\es5\subproviders\fetch.js npm ERR! subproviders\filters.js -> dist\es5\subproviders\filters.js npm ERR! subproviders\fixture.js -> dist\es5\subproviders\fixture.js npm ERR! subproviders\gasprice.js -> dist\es5\subproviders\gasprice.js npm ERR! subproviders\hooked-wallet-ethtx.js -> dist\es5\subproviders\hooked-wallet-ethtx.js npm ERR! subproviders\hooked-wallet.js -> dist\es5\subproviders\hooked-wallet.js npm ERR! subproviders\inflight-cache.js -> dist\es5\subproviders\inflight-cache.js npm ERR! subproviders\infura.js -> dist\es5\subproviders\infura.js npm ERR! subproviders\ipc.js -> dist\es5\subproviders\ipc.js npm ERR! subproviders\nonce-tracker.js -> dist\es5\subproviders\nonce-tracker.js npm ERR! subproviders\provider.js -> dist\es5\subproviders\provider.js npm ERR! subproviders\rpc.js -> dist\es5\subproviders\rpc.js npm ERR! subproviders\sanitizer.js -> dist\es5\subproviders\sanitizer.js npm ERR! subproviders\stream.js -> dist\es5\subproviders\stream.js npm ERR! subproviders\subprovider.js -> dist\es5\subproviders\subprovider.js npm ERR! subproviders\subscriptions.js -> dist\es5\subproviders\subscriptions.js npm ERR! subproviders\vm.js -> dist\es5\subproviders\vm.js npm ERR! subproviders\wallet.js -> dist\es5\subproviders\wallet.js npm ERR! subproviders\websocket.js -> dist\es5\subproviders\websocket.js npm ERR! subproviders\whitelist.js -> dist\es5\subproviders\whitelist.js npm ERR! util\assert.js -> dist\es5\util\assert.js npm ERR! util\async.js -> dist\es5\util\async.js npm ERR! util\create-payload.js -> dist\es5\util\create-payload.js npm ERR! util\estimate-gas.js -> dist\es5\util\estimate-gas.js npm ERR! util\random-id.js -> dist\es5\util\random-id.js npm ERR! util\rpc-cache-utils.js -> dist\es5\util\rpc-cache-utils.js npm ERR! util\rpc-hex-encoding.js -> dist\es5\util\rpc-hex-encoding.js npm ERR! util\stoplight.js -> dist\es5\util\stoplight.js npm ERR! npm ERR! > web3-provider-engine@14.0.6 bundle npm ERR! > mkdir -p ./dist && npm run bundle-engine && npm run bundle-zero npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter npm ERR! npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update! npm ERR! npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm ERR! npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm ERR! npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm ERR! npm WARN deprecated eth-sig-util@1.4.2: Deprecated in favor of '@metamask/eth-sig-util' npm ERR! npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm ERR! npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm ERR! npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm ERR! npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update. npm ERR! npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm ERR! npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update. npm ERR! npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm ERR! npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update. npm ERR! npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update. npm ERR! npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update. npm ERR! npm WARN deprecated ethereumjs-common@1.5.2: New package name format for new versions: @ethereumjs/common. Please update. npm ERR! npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! The syntax of the command is incorrect. npm ERR! npm ERR! code 1 npm ERR! npm ERR! path C:\Users\username\AppData\Local\npm-cache_cacache\tmp\git-cloneCvu5ow npm ERR! npm ERR! command failed npm ERR! npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build && npm run bundle npm ERR! npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! npm ERR! C:\Users\username\AppData\Local\npm-cache_logs\2022-07-22T01_38_22_408Z-debug-0.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\username\AppData\Local\npm-cache_logs\2022-07-22T01_36_34_851Z-debug-0.log`

How to resolve this? Can the code be updated please or tell me what to do. I would really appreciate it.

Also ''npm start'' results in the following but I assume this happens since the ''npm install'' gave all those errors.

PS C:\Users\username\Documents\Dapp\price-bot> npm run start npm WARN config global--global,--localare deprecated. Use--location=global` instead.

trading-bot@0.3.0 start node index.js

node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'dotenv' Require stack:

JReeGene commented 1 year ago

wipe out the node module folder, delete package-lock.json but leave the package.json. Run npm install and npm update to update any older packages. Run npm cache clear --force Run npm install dotenv.

it worked for me