CryptoTrader icon indicating copy to clipboard operation
CryptoTrader copied to clipboard

Error: Cannot find module 'app'

Open NickCorl opened this issue 7 years ago • 2 comments

C:\Users\Owner\Documents\TradingBot_V2\session-1>nodemon [nodemon] 1.14.7 [nodemon] to restart at any time, enter rs [nodemon] watching: . [nodemon] starting node index.js module.js:538 throw err; ^

Error: Cannot find module 'app' at Function.Module._resolveFilename (module.js:536:15) at Function.Module._load (module.js:466:25) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at Object. (C:\Users\Owner\Documents\TradingBot_V2\session-1\index.js:1:75) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3) [nodemon] app crashed - waiting for file changes before starting...

This is the error I am getting. My knowledge of node.js is limited however I do not understand what is means by this module app not existing! I directly copied the files you had provided here.

NickCorl avatar Jan 02 '18 03:01 NickCorl

I looks like you're using windows. You need to set the NODE_PATH to src environment variable for this to work correctly.

Here's a stack overflow Q about it, I don't have windows to hand so I can't verify but it should be something similar to this:

$ set NODE_PATH=C:\Users\Owner\Documents\TradingBot_V2\session-1\src 
$ nodemon

https://stackoverflow.com/questions/9587665/nodejs-cannot-find-installed-module-on-windows

elliottminns avatar Jan 08 '18 02:01 elliottminns

For me (Win10 user) it worked after i added the NODE_PATH to the 'environment variables' pointing to the project src folder.

Stroomer avatar May 31 '19 23:05 Stroomer