Glitch runs 'start' script even if 'install' script failed

{
  "scripts": {
    "install": "false",
    "start": "echo 'impossible!' && cd impossible && python3 -m http.server $PORT"
  },
  "engines": {
    "node": ">=10"
  }
}

in the above, I have the scripts.install set to false (false(1), not to say that I put a boolean where they want a string), meaning it never ought to succeed.

indeed, it fails as expected:

node v10.24.1, with pnpm
Installing...


> @ install /app
> false

ERROR  @ install: `false`
Exit status 1
at Error:                                                                                                                                               
at <anonymous>  /opt/nvm/versions/node/v10.24.1/lib/node_modules/pnpm/lib/node_modules/@zkochan/npm-lifecycle/index.js:303     var er = new Error('Exit…
at emit         events.js:198                                                                                                                           
at <anonymous>  /opt/nvm/versions/node/v10.24.1/lib/node_modules/pnpm/lib/node_modules/@zkochan/npm-lifecycle/lib/spawn.js:55  cooked.emit('close', cod…
at emit         events.js:198                                                                                                                           
at maybeClose   internal/child_process.js:982                                                                                                           
at onexit       internal/child_process.js:259

but immediately after that, it runs the scripts.start command, resulting in this being served after all

https://cotton-comfortable-healer.glitch.me/

what’s with that? I kind of don’t want to risk starting my apps with incomplete initialization

1 Like

Hey @wh0 this is a good catch; thanks for the report and the info! I’ve added it to our backlog to discuss.

~cori

5 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.