After adding 'ytdl-core' to node_module in files. I tried to use it for a discord bot by requiring (const ytd1 = require('ytd1-core');
) but it errors and does this:
module.js:538
throw err;
^
Error: Cannot find module 'ytd1-core'
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.<anonymous> (C:\Users\David\Documents\Discord Bot\discordbot.js:14:14)
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)
I tried looking up fixes, in my terminal I used npm install ytdl-core
, yarn add ytdl-core
and nothing happened. The folder does exist with no pop up error.
The bot can find the discord.js file in the node_module but not ytdl-core. I don't know if it didn't install right, if I have to do something manually, or make it a global file.