Cannot use pnpm or npm?


#1

Hey fellas, just got a problem, I was going to install discord.js and a couple of other packages onto my new project but upon typing ‘pnpm i discord.js’ I received the error '/usr/bin/env: ‘node’: No such file or directory

Then I tried ‘npm i discord.js’ which also yielded me an error, although this time, a different one, ‘bash: npm: command not found’

Anyone know this problem and how to fix it? Help is appreciated.


#2

What type of project did you create (as in, which option did you choose from the new project drop-down)? Those commands should just work, but we do recommend just adding projects to the package.json file to install them. Since it’s a new project I suggest starting a new one, using the Hello-express option and trying again. Let us know if problems persist.


#3

Hey, thanks for getting back to me.
I selected the hello-express option like I did for my previous Discord project that worked.


#4

Haio, just add discord.js to package.json


#5

Thanks for clarifying - something definitely went wrong with that project so create a new one and see if that works.