-1
i am starting now with js , and decided to make a bot for Discord servers, as I use the platform a lot. I started watching tutorials, and I made my first bot hosting on Repl.it, as I didn’t really like the site, and most of the examples and tutorials are by vs code, I decided to try to do one by vs code, so I started by following the tutorial and adding Discord.js to my project, following the steps of the tutorial I tried to start npm in my bot folder, and gave an error, follow the error and print of the error:
(Node:17552) Unhandledpromiserejectionwarning: Error: An invalid token was provided.
AT: Users Youtu Documents Sounnybot node_modules Discord.js src client Rest Restmethods.js:36:54
at new Promise ()
at Restmethods.login (C: Users Youtu Documents Sounnybot node_modules Discord.js src client Rest Restmethods.js:35:12)
At client.login (C: Users Youtu Documents Sounnybot node_modules Discord.js src client Client.js:280:30)
At object. (C: Users Youtu Documents Sounnybot core.js:15:8)
At module. _Compile (Internal/modules/cjs/Loader.js:1063:30)
At object.Module. _Extensions.. js (Internal/modules/cjs/Loader.js:1092:10)
At module.load (Internal/modules/cjs/Loader.js:928:32)
At function.Module. _load (Internal/modules/cjs/Loader.js:769:14)
At function.executeUserEntryPoint [as runMain] (Internal/modules/run_main.js:72:12)
(Use node --trace-warnings ...
to show Where the Warning was created)
(Ode:17552) Unhandledpromiserejectionwarning: Unhandled Promise rejection. This error either originated by Throwing Inside of an async Function without a catch block, or by rejecting a Promise which was not handled with . (catch). To terminate the Node process on unhandled Promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(Ode:17552) [DEP0018] Deprecationwarning: Unhandled Promise rejections are deprecated. In the Future, Promise rejections that are not handled will terminate the Node.js process with a non-zero Exit code.
and my script folder is only with: "test": "echo "Error: no test specified" && Exit 1", "start": "Node core" as I just started the project has virtually nothing on it.
Tried to spin a
npm install
?– Maurício Silva
yes, but it was not, it already excludes node_modules and package-lock.json and dei npm update , install , but nn will
– Gabriel