PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, August 19, 2022

[FIXED] What is wrong with my crypto price discovery bot?

 August 19, 2022     algorithmic-trading, bots, environment-variables, node.js     No comments   

Issue

I'm following Dapp Universitie's Create a PROFITABLE cryptocurrency trading bot video.

I use git and npm install but when I run npm run start in the terminal I get the following:

node index.js

internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module 'dotenv'
Require stack:
- C:\Users\Kazuriah...index.js
.
.
.
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'MODULE_NOT_FOUND',

Any ideas what went wrong? I'm sure you want to look at my code but I really didn't edit anything from the GitHub link he provides in the video other then the .env file https://github.com/dappuniversity/price-bot


Solution

Yeah it looks like your npm install did not work as expected, and didn't install all the dependencies. I just tried cloning the repo you linked down, and was able to get all the dependencies.

The package.json lists dotenv so if it worked, it shouldn't fail.

Did you make sure to delete the package-lock.json file before you ran your npm install, because that may cause some issues if it is out of date.

Take a look at my screenshot and you can see how I went about installing it and was able to run the program, only failing because I don't have the API keys in my .env file.

Price-bot installation Windows 10 with Cmder command prompt terminal



Answered By - treckstar
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing