dappuniversity / price-bot

397 stars 392 forks source link

cannot find module 'dotenv' #20

Open jon3nity opened 3 years ago

jon3nity commented 3 years ago

after running the npm run start command, i get the error below:

`

trading-bot@0.3.0 start node index.js

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

Error: Cannot find module 'dotenv' Require stack:

Genoux commented 3 years ago

Did you run npm i to install node_module packages?

jon3nity commented 3 years ago

you mean npm install? yes i did and now get this error Screenshot (174)

sudo-vaibhav commented 3 years ago

do

npm i express
ccoop1 commented 2 years ago

do

npm i express

Hey I'm having the same issue - when I follow your advice I end up with the same message but here is why do you have any idea how to solve this by chance??

$ npm i express 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\n ode_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27) npm WARN old lockfile at ChildProcess.emit (node:events:394:28) npm WARN old lockfile at maybeClose (node:internal/child_process:1067:16) npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/ child_process:301:5) npm WARN old lockfile Could not fetch metadata for web3-provider-engine@git+ssh ://git@github.com/trufflesuite/provider-engine.git#3538c60bc4836b73ccae1ac3f64c8 fed8ef19c1a Error: git dep preparation failed npm WARN old lockfile at ChildProcess. (C:\Program Files\nodejs\n ode_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27) npm WARN old lockfile at ChildProcess.emit (node:events:394:28) npm WARN old lockfile at maybeClose (node:internal/child_process:1067:16) npm WARN old lockfile at Process.ChildProcess._handle.onexit (node:internal/ child_process:301: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\np m-cli.js', npm WARN old lockfile 'install', npm WARN old lockfile '--force', npm WARN old lockfile '--cache=C:\Users\labor\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 ], 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 subprov iders -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\ca che.js\n' + npm WARN old lockfile 'subproviders\default-fixture.js -> dist\es5\subpro viders\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\fe tch.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\su bproviders\hooked-wallet-ethtx.js\n' + npm WARN old lockfile 'subproviders\hooked-wallet.js -> dist\es5\subprovi ders\hooked-wallet.js\n' + npm WARN old lockfile 'subproviders\inflight-cache.js -> dist\es5\subprov iders\inflight-cache.js\n' + npm WARN old lockfile 'subproviders\infura.js -> dist\es5\subproviders\i nfura.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\subprovi ders\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\s tream.js\n' + npm WARN old lockfile 'subproviders\subprovider.js -> dist\es5\subprovide rs\subprovider.js\n' + npm WARN old lockfile 'subproviders\subscriptions.js -> dist\es5\subprovi ders\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\w allet.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-pa yload.js\n' + npm WARN old lockfile 'util\estimate-gas.js -> dist\es5\util\estimate-ga s.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-cach e-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 safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-emitter\n' + npm WARN old lockfile 'npm WARN deprecated babel-preset-es2015@6.24.1: 🙌 T hanks for using Babel: we recommend using babel-preset-env now: please read http s://babeljs.io/env to update!\n' + npm WARN old lockfile 'npm WARN deprecated urix@0.1.0: Please see https://gi thub.com/lydell/urix#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 resolve-url@0.2.1: https://github .com/lydell/resolve-url#deprecated\n' + npm WARN old lockfile 'npm WARN deprecated chokidar@1.7.0: Chokidar 2 will b reak on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-block@2.2.2: New packa ge name format for new versions: @ethereumjs/block. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated querystring@0.2.0: The querystrin g API is considered Legacy. new code should use the URLSearchParams API instead. \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 uuid@3.4.0: Please upgrade to ve rsion 7 or higher. Older versions may use Math.random() in certain circumstance s, which is known to be problematic. See https://v8.dev/blog/math-random for de tails.\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-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-block@1.7.1: New packa ge name format for new versions: @ethereumjs/block. Please update.\n' + npm WARN old lockfile 'npm WARN deprecated ethereumjs-common@1.5.2: New pack age 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.3 is n o longer maintained and not recommended for usage due to the number of issues. B ecause of the V8 engine whims, feature detection in old core-js versions could c ause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your d ependencies to the actual version of core-js.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabl ed.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabl ed.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabl ed.\n' + npm WARN old lockfile 'npm WARN using --force Recommended protections disabl ed.\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\labor\AppData\Local\npm-c ache\_cacache\tmp\git-clone-2d7a3ffa\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\labor\AppData\Local\npm-ca che\_logs\2021-07-29T00_05_03_154Z-debug.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.5.0', npm: '7.19.1' } npm WARN EBADENGINE } npm WARN deprecated safe-event-emitter@1.0.1: Renamed to @metamask/safe-event-em itter npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer m aintained. '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-block@2.2.2: New package name format for new vers ions: @ethereumjs/block. Please update. npm WARN deprecated uuid@2.0.1: Please upgrade to version 7 or higher. Older v ersions may use Math.random() in certain circumstances, which is known to be pro blematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new version s: @ethereumjs/tx. Please update. npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older v ersions may use Math.random() in certain circumstances, which is known to be pro blematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older v ersions may use Math.random() in certain circumstances, which is known to be pro blematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://git hub.com/request/request/issues/3142 npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new version s: @ethereumjs/tx. Please update. npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new version s: @ethereumjs/vm. Please update. npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new vers ions: @ethereumjs/block. 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 ver sions: @ethereumjs/common. Please update. npm WARN deprecated core-js@2.6.11: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whi ms, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual v ersion of core-js. npm ERR! code 1 npm ERR! git dep preparation failed npm ERR! command C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_m odules\npm\bin\npm-cli.js install --force --cache=C:\Users\labor\AppData\Local\n pm-cache --prefer-offline=false --prefer-online=false --offline=false --no-progr ess --no-save --no-audit 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-fixtur e.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-wal let-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 Ba bel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update! npm ERR! npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/ur ix#deprecated npm ERR! npm WARN deprecated har-validator@5.1.5: this library is no longer supp orted npm ERR! npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolv e-url#deprecated 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 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 considere d Legacy. new code should use the URLSearchParams API instead. npm ERR! npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for ne w 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 ht tps://github.com/request/request/issues/3142 npm ERR! npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for ne w versions: @ethereumjs/tx. Please update. npm ERR! npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for ne w versions: @ethereumjs/vm. 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-common@1.5.2: New package name format fo r new versions: @ethereumjs/common. Please update. npm ERR! npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintaine d and not recommended for usage due to the number of issues. Because of the V8 e ngine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN using --force Recommended protections disabled. 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\labor\AppData\Local\npm-cache_cacache\tmp\git-c lone-88c68497 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\labor\AppData\Local\npm-cache_logs\2021-07-29T00 _05_35_144Z-debug.log

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\labor\AppData\Local\npm-cache_logs\2021-07-29T00_05_48_22 5Z-debug.log

lggg123 commented 2 years ago

delete your package-lock.json file and npm install again. Any dependencies they do no have installed simply use npm i npm is a node package manager and manages all of your packages to be able to run code. Check out what it is so you have a better idea of what you are doing. Environment setup can be a pain, sorry usually is a pain...