Question: my repl is saying that it cant find index.js
Repl link: https://replit.com/@rynnkim/discord
Error: Cannot find module '/home/runner/discord/index.js'
Require stack:
- /nix/store/qpnf0dafrfsbcwb4z7cphjm0dff0vl7l-prybar-nodejs-0.0.0-e0d9a52/prybar_assets/nodejs/module-context-hook.js
- /tmp/prybar-nodejs-647634110.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Function.resolve (node:internal/modules/cjs/helpers:109```
Hello @rynnkim and welcome to the community!
In your package.json file, the start
script is set to node . --trace-warnings
. The environment is looking for the index.js
file in the root directory, because node .
means it should execute the index.js
file located in the root directory. And looking to you structure, your index is not in the root but inside a folder called src.
You have to change the start
script to explicitly point at your index.js
file located inside the src
directory. Like this:
"start": "node src/index.js --trace-warnings",