Error in Discord Bot startup (package.json)

So when I go to start up my discord bot, I get this error: “/opt/watcher/app-types/node/start.sh: line 49: null: command not found”. I have looked up the solution for this and tried adding the “scripts”: { “start”: “node aecro.js” }, but my error is still there.
Project Name - aecor.js

Hey @MrTunaa,
Can you please send your package.json file content here?

Hi @MrTunaa, Welcome To Forums. I went to your package.json to find out that you added

"scripts":
		{
			"start": "node bott.js"
		}

inside dependencies. This is what causing error.

To fix, change package.json as

{
	"name": "Aecor",
	"author": "MrTuna",
	"main": "bot.js",
	"version": "1.2.9",
	"dependencies":
	{
		"discord.js": "^11.3.0",
		"extend": "^3.0.2",
		"fstorm": "^0.1.3",
		"jimp": "^0.2.28",
		"request": "^2.88.0",
		"valid-url": "^1.0.9"
	},
     "scripts":
		{
			"start": "node bott.js"
		}
}

Hey there,

As @Ashutosh-3601 mentioned. If you notice properly, you haven’t added a parenthesis to close the dependencies field. However, if you close it,the error will cease.

That did remove the first error, But it created a new one. parse error: Expected another key-value pair at line 14, column 3

{
“name”: “Aecor”,
“author”: “MrTuna”,
“main”: “bot.js”,
“version”: “1.2.9”,
“dependencies”:
{
“discord.js”: “^11.3.0”,
“extend”: “^3.0.2”,
“fstorm”: “^0.1.3”,
“jimp”: “^0.2.28”,
“request”: “^2.88.0”,
“valid-url”: “^1.0.9”,
},
“scripts”:
{
“start”: “node bott.js”
}
}

Hey @MrTunaa,
Here’s a refined and beautified version of your package.json file:

{
  "name": "Aecor",
  "author": "MrTuna",
  "main": "bot.js",
  "version": "1.2.9",
  "dependencies": {
    "discord.js": "^11.3.0",
    "extend": "^3.0.2",
    "fstorm": "^0.1.3",
    "jimp": "^0.2.28",
    "request": "^2.88.0",
    "valid-url": "^1.0.9"
  },
  "scripts": {
    "start": "node bott.js"
  }
}

Thanks, this helped me a lot and removed my errors. I really appreciate it :slight_smile:
(from both of you)

1 Like

Sorry for that, Its my mistake. To fix, remove the , (comma) from last dependency that is “valid-url”: “^1.0.9”