question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Argument list too long

See original GitHub issue

Description

I have a big project where I use a tslint, and I needed to check 450 files before committing, but an error occurred. But if I copy this command directly, there will be no error.

~/admin-webapp/node_modules/.bin/tslint: Argument list too long npm ERR! code ELIFECYCLE npm ERR! errno 126

My lint-staged config:

{
  "linters": {
    "*.ts": ["npm run lint", "git add"]
  },
  "ignore": ["**/*.spec.ts"]
}

package.json

 "lint": "tslint -c tslint.json --project src/tsconfig.json",

Steps to reproduce

Add more 360 files run lint-staged through npm run lint

Debug Logs

expand to view
~/admin-webapp/node_modules/.bin/tslint: Argument list too long
npm ERR! code ELIFECYCLE
npm ERR! errno 126

Environment

  • OS: macOS High Sierra
  • Node.js: v8.9.1
  • lint-staged: v7.3.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
okonetcommented, Oct 15, 2018

Yeah, but I think that’s the behavior I’d like to enforce in this case. Linting hundreds of files is no different from linting the whole project, which should be done on CI. It’s about common sense and best practices. I don’t want lint-staged to be the single point of failure.

1reaction
okonetcommented, Oct 15, 2018

I think we should just print a more friendlier message and suggest to skip the run for such cases. The splitting part is rather complex and makes the code harder to maintain. I also believe the case is so rare it’s not worth doing. I hardly believe there is value in using lint-stages on hundreds of files. CI should cover that. What do you think @sudo-suhas?

Read more comments on GitHub >

github_iconTop Results From Across the Web

bash: /usr/bin/rm: Argument list too long - Solution
“Argument list too long” indicates when a user feeds too many arguments into a single command which hits the ARG_MAX limit.
Read more >
Argument list too long error for rm, cp, mv commands
No, rm has no such limit on the number of files it will process (other than that its argc cannot be larger than...
Read more >
The “Argument List Too Long” Error in Linux Commands
In this tutorial, we'll look at the “argument list too long” problem, often encountered while working with a large number of files.
Read more >
SOLUTION: /bin/rm: argument list too long - Linux Hint
The “Argument list too long” error does not come, for that the user can find out what the length of the command should...
Read more >
(Resolved) – /bin/rm: Argument list too long - TecAdmin
If there are a large number of files in a single directory, Then the traditional rm command can not delete all files and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found