/opt/watcher/app-types/node/start.sh: line 49: null: command not found

I was trying to create a glitch node.js app with grunt-android-emulator. However, the status keeps returning as " /opt/watcher/app-types/node/start.sh: line 49: null: command not found"

Hi @PineappleBox, welcome to Glitch!

Can you provide a snippet of your package.json file that includes the “scripts” node so we can take a look? Or provide the name of your project?

My guess is that you’re asking node to do something on startup that isn’t available, but there can be a number of different reasons for that to be the case.

Okay, here you go:
{
“name”: “grunt-android-emulator”,
“description”: “Create, Start, Unlock, Stop Android emulators, Install APK, Start Activities”,
“title”: “Grunt Android Emulator”,
“version”: “0.1.7”,
“homepage”: “https://github.com/tolis-e/grunt-android-emulator”,
“repository”: {
“type”: “git”,
“url”: “git://github.com/tolis-e/grunt-android-emulator.git”
},
“author”: {
“name”: “Tolis Emmanouilidis”,
“url”: “http://github.com/tolis-e/grunt-android-emulator”
},
“maintainers”: {
“name”: “Tolis Emmanouilidis”,
“email”: "tolisemm@gmail.com"
},
“licenses”: [
{
“type”: “Apache-2.0”,
“url”: “http://www.apache.org/licenses/LICENSE-2.0”
}
],
“keywords”: [
“android”,
“android emulator”,
“emulator”,
“mobile”
],
“dependencies”: {
“shelljs”: “~0.7.6”,
“grunt”: “^1.0.3”,
“grunt-android-emulator”: “^0.1.6”
},
“devDependencies”: {
“grunt”: “~0.4.5”,
“grunt-contrib-jshint”: “~0.10.0”
}
}

1 Like

The problem here is that you don’t even have a scripts entry in your package.json. The node startup script uses the value of “scripts/start” and executes the command(s) it finds there. Since you don’t have one it tries to execute null and returns this error message.

The default node.js project’s “scripts” node looks like this:

  "scripts": {
    "start": "node server.js"
  },

If you put something like that in there that contains a command that bash can execute and this error will go away.

Hope this helps!

1 Like

this is my package.json but still getting this error “/opt/watcher/app-types/node/start.sh: line 51: index.js: command not found”
{
“name”: “@south-paw/discord-music-bot”,
“version”: “0.0.1”,
“description”: “A music bot for Discord servers, self-hosted, easy to use and extendable.”,
“keywords”: [
“discord”,
“bot”,
“music”,
“musicbot”,
“radio”
],
“homepage”: “REMOVED THE LINKt”,
“bugs”: “REMOVED THE LINK”,
“license”: “GPL-3.0”,
“author”: {
“name”: “Alex Gabites”,
“email”: “REMOVED THE LINK”,
“url”: “REMOVED THE LINK/”
},
“files”: [
“bin”,
“src”
],
“bin”: {
“discord-music-bot”: “./bin/cli.js”
},
“main”: “src/index.js”,
“repository”: {
“type”: “git”,
“url”: “REMOVED THE LINK”
},
“scripts”: {
“lint”: “eslint .”,
“prepublishOnly”: “yarn lint && yarn test”,
“test”: “jest”,
“start”: “index.js”
},
“dependencies”: {
“dateformat”: “^3.0.3”,
“deepmerge”: “^3.0.0”,
“discord.js”: “^11.4.2”,
“meow”: “^5.0.0”,
“string-format”: “^2.0.0”
},
“devDependencies”: {
“coveralls”: “^3.0.2”,
“eslint”: “^5.11.1”,
“eslint-config-airbnb-base”: “^13.1.0”,
“eslint-config-prettier”: “^3.3.0”,
“eslint-plugin-import”: “^2.14.0”,
“eslint-plugin-jest”: “^22.1.2”,
“eslint-plugin-prettier”: “^3.0.1”,
“jest”: “^23.6.0”,
“prettier”: “^1.15.3”
},
“engines”: {
“node”: “>=10.15.0”
},
“publishConfig”: {
“access”: “public”
}
}

@HappyFone,

Thanks for posting!

It looks like you need to update your scripts start in your package.json.
Can you please try changing "start": "index.js" to "start": "node index.js"

If that does not fix things, you can reply with the name of the project and we can take a closer look!

{
“//1”: “describes your app and its dependencies”,
“//2”: “https://docs.npmjs.com/files/package.json”,
“//3”: “updating this file will download and update your packages”,
“name”: “hello-express”,
“version”: “0.0.1”,
“description”: “A simple Node app built on Express, instantly up and running.”,
“main”: “server.js”,
“scripts”: {
“start”: “node main.js”
},
“dependencies”: {
“better-sqlite-pool”: “^0.2.3”,
“body-parser”: “^1.19.0”,
“cache”: “^2.1.0”,
“chalk”: “^3.0.0”,
“clean”: “^4.0.2”,
“discord-anti-spam”: “^2.3.5”,
“discord.js”: “^11.5.1”,
“enmap”: “^5.2.4”,
“fs”: “^0.0.2”,
“helmet”: “^3.21.2”,
“klaw”: “^3.0.0”,
“marked”: “^0.8.0”,
“memorystore”: “^1.6.2”,
“moment”: “^2.24.0”,
“moment-duration-format”: “^2.2.2”,
“ms”: “^2.1.2”,
“parse-time”: “^0.1.4”,
“querystring”: “^0.2.0”,
“quick.db”: “^7.0.0-b22”,
“readline-sync”: “^1.4.10”,
“snekfetch”: “^4.0.4”,
“sqlite3”: “^4.1.1”,
“weather-js”: “^2.0.0”,
“array-sort”: “^1.0.0”,
“express”: “^4.17.1”,
“table”: “^5.4.6”,
“common-tags”: “^1.8.0”,
“mathjs”: “^6.6.0”,
“node-fetch”: “^2.6.0”,
“https”: “^1.0.0”,
“arisia-api”: “^1.0.1”
},
“engines”: {
“node”: “10.x”
},
“repository”: {
“url”: “https://glitch.com/edit/#!/hello-express”
},
“license”: “MIT”,
“keywords”: [
“node”,
“glitch”,
“express”
]
}

And for this package.json ?