Using pnpm as package manager results in wonky import errors. Using yarn works fine. #10220
Replies: 3 comments
-
This is your end according to the data you provided. If you have had trouble with another library, then install discord.js the same way you installed |
Beta Was this translation helpful? Give feedback.
-
Considering a lot of us internally use pnpm (and even our monorepo) runs on it, this does sound like it might be on your end 😅 Do you do anything special in your codebase? Like a |
Beta Was this translation helpful? Give feedback.
-
Seems like pnpm is struggling with dependency resolution, while Yarn handles it better by default. You could try pnpm install --shamefully-hoist or clearing the store with pnpm store prune. I’ve run into similar issues before with certain packages. By the way, if you're into useful resources, you might find this site interesting! |
Beta Was this translation helpful? Give feedback.
-
Decided to give discord.js a try and when installing packages with pnpm I get this error when importing
SlashCommandBuilder
: Module "discord.js" has no exported member SlashCommandBuilder. When using yarn it works just fine.Importing like this:
What could be the issue here?
I've had some related issues when using pnpm to install some
@testing-library
packages and in the end I just had to add more devDependencies because pnpm wasn't adding some chained deps for some reason, so I'm guessing this would be the case.More of a curiosity than anything else, I'll keep using yarn for the time being.
Beta Was this translation helpful? Give feedback.
All reactions