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

cannot find module 'dotenv' #20

Open
jon3nity opened this issue Mar 17, 2021 · 5 comments
Open

cannot find module 'dotenv' #20

jon3nity opened this issue Mar 17, 2021 · 5 comments

Comments

@jon3nity
Copy link

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

`

[email protected] start
node index.js

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

Error: Cannot find module 'dotenv'
Require stack:

  • C:\Users\user\price-bot\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object. (C:\Users\user\price-bot\index.js:1:1)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [ 'C:\Users\user\price-bot\index.js' ]
    }`
@Genoux
Copy link

Genoux commented Mar 21, 2021

Did you run npm i to install node_module packages?

@jon3nity
Copy link
Author

jon3nity commented Mar 22, 2021

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

@sudo-vaibhav
Copy link

do

npm i express

@ccoop1
Copy link

ccoop1 commented Jul 29, 2021

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
://[email protected]/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 '> [email protected] 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 '> [email protected] 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 '> [email protected] 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 [email protected]: Renamed
to @metamask/safe-event-emitter\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: 🙌 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 [email protected]: Please see https://gi
thub.com/lydell/urix#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: this library
is no longer supported\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: https://github
.com/lydell/resolve-url#deprecated\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: Chokidar 2 will b
reak on node v14+. Upgrade to chokidar 3 with 15x less dependencies.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New packa
ge name format for new versions: @ethereumjs/block. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: The querystrin
g API is considered Legacy. new code should use the URLSearchParams API instead.
\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package
name format for new versions: @ethereumjs/tx. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: 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 [email protected]: request has been
deprecated, see https://github.com/request/request/issues/3142\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package
name format for new versions: @ethereumjs/tx. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New package
name format for new versions: @ethereumjs/vm. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New packa
ge name format for new versions: @ethereumjs/block. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: New pack
age name format for new versions: @ethereumjs/common. Please update.\n' +
npm WARN old lockfile 'npm WARN deprecated [email protected]: 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: '[email protected]',
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 [email protected]: Renamed to @metamask/safe-event-em
itter
npm WARN deprecated [email protected]: This package is broken and no longer m
aintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: New package name format for new vers
ions: @ethereumjs/block. Please update.
npm WARN deprecated [email protected]: 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 [email protected]: New package name format for new version
s: @ethereumjs/tx. Please update.
npm WARN deprecated [email protected]: 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 [email protected]: 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 [email protected]: request has been deprecated, see https://git
hub.com/request/request/issues/3142
npm WARN deprecated [email protected]: New package name format for new version
s: @ethereumjs/tx. Please update.
npm WARN deprecated [email protected]: New package name format for new version
s: @ethereumjs/vm. Please update.
npm WARN deprecated [email protected]: New package name format for new vers
ions: @ethereumjs/block. Please update.
npm WARN deprecated [email protected]: Critical security vulnerability fixed in v0.21
.1. For more information, see axios/axios#3410
npm WARN deprecated [email protected]: New package name format for new ver
sions: @ethereumjs/common. Please update.
npm WARN deprecated [email protected]: 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! > [email protected] prepublish
npm ERR! > npm run build && npm run bundle
npm ERR!
npm ERR!
npm ERR! > [email protected] 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! > [email protected] 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 [email protected]: Renamed to @metamask/safe
-event-emitter
npm ERR! npm WARN deprecated [email protected]: 🙌 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 [email protected]: Please see https://github.com/lydell/ur
ix#deprecated
npm ERR! npm WARN deprecated [email protected]: this library is no longer supp
orted
npm ERR! npm WARN deprecated [email protected]: https://github.com/lydell/resolv
e-url#deprecated
npm ERR! npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+.
Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! npm WARN deprecated [email protected]: New package name format for
new versions: @ethereumjs/block. Please update.
npm ERR! npm WARN deprecated [email protected]: The querystring API is considere
d Legacy. new code should use the URLSearchParams API instead.
npm ERR! npm WARN deprecated [email protected]: New package name format for ne
w versions: @ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated [email protected]: 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 [email protected]: request has been deprecated, see ht
tps://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated [email protected]: New package name format for ne
w versions: @ethereumjs/tx. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format for ne
w versions: @ethereumjs/vm. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format for
new versions: @ethereumjs/block. Please update.
npm ERR! npm WARN deprecated [email protected]: New package name format fo
r new versions: @ethereumjs/common. Please update.
npm ERR! npm WARN deprecated [email protected]: 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
Copy link

lggg123 commented Nov 14, 2021

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...

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

5 participants