0

Currently I am using lerna@3.22.1. I am having problems with lerna in lint-staged. I'm receiving a weird error:

ERR! lerna Unknown arguments: and after that the path for all the committed files.

enter image description here

package.json in root folder:

scripts: {
 ...
 "lint:fix": "lerna run --scope @polusai/plots-explorer lint:fix"
 },
"husky": {
    "hooks": {
      "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
      "pre-commit.legacy": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,json,css,md,ejs,html}": [
      "npm run lint:fix"
    ]
  },

package.json in packages/myproj

scripts: {
 ...
 "lint:fix": "ng lint -- --fix && npm run prettier:fix",
}
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -e $HUSKY_GIT_PARAMS",
      "pre-commit.legacy": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{ts,js,json,css,md,ejs,html}": [
      "npm run lint:fix"
    ]
  }

My lint staged was working fine until I cancelled a commit while the linting was running. I've tried going through the usual suspect fixes. I tried deleting my packagelock and reinstalling my node modules, downloading a fresh copy of my repo, and switching versions of node and this issue persists. I tried searching for a place where something might be cached and haven't found anything that has worked. Are there any reccomendations to fix this?

Edit -- This command works on other people's computer when they clone the repo for the first time or after bringing down a fresh copy. When I brought down a fresh copy, I still get this error. I'm thinking the problem is with my environment because it is persisting across instances of the repo on my machine and others don't get the same problem. I tried clearing precommit caache and it didn't work. Are there any other caches that I should look at? I tried looking at lerna cache. It seems that it uses nx to cache files, but with my version I was unable to access the cache. Also I tried the skipCache flag when running the command. I also tried uninstalling and reinstalling lerna but it didn't work. Could a permission on a file have changed? I would think testing different versions of node would have tested this hypothesis.

Ahmed Sbai
  • 10,695
  • 9
  • 19
  • 38
afriedman111
  • 1,925
  • 4
  • 25
  • 42

0 Answers0