Skip to content

Allow --inspect flag to be provided after script name #11028

Closed
@scottmas

Description

@scottmas
  • Version: 7.4
  • Platform: Sierra OSx

Currently, only this works

node --inspect myscript.js

It seems dumb that the following shouldn't work

node myscript.js --inspect

This becomes especially important when doing complex npm run scripts with passed arguments. For instance, if this feature existed, then we could define a regular run-script and a debug run-script in our package.json, like so

"scripts": {
  "regular": "node myscript.js",
  "debug": "npm run regular -- --inspect"
}

But this fails for the reasons described above.

Also, it just makes sense that order shouldn't matter with command line flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliIssues and PRs related to the Node.js command line interface.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions