Error: Cannot find module 'discord.js'


Hi there,

i am a new coder that trying to code a discord bot with discord js and run into some tutorials in hosting as well. But i seem to hit this error where discord.js is not found from my simple bot file

here is my package.json
“name”: “rembot”,
“version”: “1.0”,
“description”: “Test bot”,
“main”: “node rem.js”,
“scripts”: {
“test”: “echo “Error: no test specified” && exit 1”,
“start”: “node rem.js”
“dependencies”: {
“express”: “^4.16.3”,
“discord.js”: “^11.3.2”,
“enmap”: “^2.1.0”,
“moment”: “^2.22.0”,
“moment-duration-format”: “^2.2.2”
“engines”: {
“node”: “8.4.0”
“repository”: {
“url”: “!/intothefantasy
“license”: “MIT”,
“keywords”: [


Hi @intothefantasy,

your package.json has an error (well, in Glitch it is counted as an error): your version field does not contain a valid semver. This is why the packages don’t get installed. You should set it to 1.0.0 (for example), and then the packages will be installed. If you scroll up in the Logs, you’ll see that this error is reported.

Let us know if this fixes your issue :slight_smile:


Hi there

thanks for the response, it fixes my issue after removing the version


Hello Can you tell me how you fixed
Step by step
I am still getting this error. :frowning:


In the above scenario, you go into the package.json file and change the value alongside ‘version’ to 1.0.0. However, there are a few potential causes of this problem, so if that doesn’t fix it then provide your project name and we can take a look for you.