I am new to TypeScript, and I’m using the VSCode Extension, I have discord.js
installed, but VSCode is saying Cannot find module 'discord.js'.ts(2307)
, my code: import { User, GuildMember, Channel, Role, Snowflake } from 'discord.js';
1 Like
I also had this issue but with express. My workaround was to go to the project in the cache directory and npm install
. Not sure if there’s a better solution. On Windows, my cache directory was at %userprofile%\.vscode-glitch\cache
1 Like
Im having the same issue, I was trying to console.log() one of the commands I had worked on, but in the main server.js file for some reason the discord.js file now couldnt be found. obviously this caused my bot to go offline and I dont know how to fix this.
Uh, that’s not what this topic is about, this topic is about an editor not finding a module, in your case, your project can’t find d.js, and therefore it throws, try npm install --save discord.js --force