Closed r1zyn closed 2 years ago
Your node-fetch
version is 2.x.x but your @types/node-fetch
is 3.x.x, i recommend installing @types/node-fetch@cjs
for node-fetch
2.x.x
Also please ask in the discord server for general questions
Alright, I’ll try it out. I tried asking in the server but no-one knew so I ended up opening an issue.
Your
node-fetch
version is 2.x.x but your@types/node-fetch
is 3.x.x, i recommend installing@types/node-fetch@cjs
fornode-fetch
2.x.xAlso please ask in the discord server for general questions
@types/node-fetch@cjs
doesn't exist in the NPM registry.
Your
node-fetch
version is 2.x.x but your@types/node-fetch
is 3.x.x, i recommend installing@types/node-fetch@cjs
fornode-fetch
2.x.xAlso please ask in the discord server for general questions
@types/node-fetch@cjs
doesn't exist in the NPM registry.
Oh my bad, it would be @types/node-fetch@2
Yeah, I found this here. I installed an older version and it worked fine. https://github.com/node-fetch/node-fetch/issues?q=Could+not+find+a+declaration+file+for+module+%27node-fetch%27
Issue description
Whenever I try to compile to JavaScript from TypeScript, the compiler throws the errors showing at the bottom. I tried installed
@types/node-fetch
andurl
again, but the problem still persisted. Note: thesrc
folder contains the TypeScript code and thedist
folder contains the compiled JavaScript code.Note: The node_modules folder is not included in the repository.
Reproduction You can find the code in my GitHub repository here. Make sure you have TypeScript installed. Step 1: Create an .env file in the root directory. The variables are
TOKEN
(your bot's token) Step 2: Runnpm run dev
in the terminal (this script is declared in the scripts property in package.json)TypeScript should throw the following errors:
Code sample
discord.js version
13.2.0
Node.js version
16.5.0
Operating system
Windows 10 Home
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
USER, CHANNEL, GUILD_MEMBER, MESSAGE, REACTION
Which gateway intents are you subscribing to?
GUILDS, GUILD_MEMBERS, GUILD_BANS, GUILD_EMOJIS_AND_STICKERS, GUILD_INTEGRATIONS, GUILD_WEBHOOKS, GUILD_INVITES, GUILD_VOICE_STATES, GUILD_PRESENCES, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS, GUILD_MESSAGE_TYPING, DIRECT_MESSAGES, DIRECT_MESSAGE_REACTIONS, DIRECT_MESSAGE_TYPING
I have tested this issue on a development release
761a901