How can I solve [error] No files matching the pattern were found: npx prettier --write $(git diff HEAD origin/master --name-only)

Viewed 531

I have set up for ionic 5 application.

  1. Installed prettier as global and even added all the eslint and prettier dependencies
  2. run npm install
  3. configured my package.json script to run eslint-fix

After while trying to run npx prettier --write $(git diff origin/master --name-only) getting below error, shows the error reporting No files matching the pattern were found

NPM log as below

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'lint-fix' ]
2 info using npm@6.14.11
3 info using node@v14.15.5
4 verbose run-script [ 'prelint-fix', 'lint-fix', 'postlint-fix' ]
5 info lifecycle AvPlat@0.0.1~prelint-fix: AvPlat@0.0.1
6 info lifecycle AvPlat@0.0.1~lint-fix: AvPlat@0.0.1
7 verbose lifecycle AvPlat@0.0.1~lint-fix: unsafe-perm in lifecycle true
8 verbose lifecycle AvPlat@0.0.1~lint-fix: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/avplat/Roshan/AvplatV3/avplat-v3/node_modules/.bin:/usr/local/opt/php@7.4/sbin:/usr/local/opt/php@7.4/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/opt/php@7.4/sbin:/usr/local/opt/php@7.4/bin:/opt/local/bin:/opt/local/sbin:/Users/avplat/Library/Android/sdk/tools:/Users/avplat/Library/Android/sdk/platform-tools:/Users/avplat/Developer/flutter/bin:/Users/avplat/Library/Android/sdk/tools:/Users/avplat/Library/Android/sdk/platform-tools:/Users/avplat/Developer/flutter/bin
9 verbose lifecycle AvPlat@0.0.1~lint-fix: CWD: /Users/avplat/Roshan/AvplatV3/avplat-v3
10 silly lifecycle AvPlat@0.0.1~lint-fix: Args: [ '-c', 'bash scripts/lint.sh' ]
11 silly lifecycle AvPlat@0.0.1~lint-fix: Returned: code: 2  signal: null
12 info lifecycle AvPlat@0.0.1~lint-fix: Failed to exec lint-fix script
13 verbose stack Error: AvPlat@0.0.1 lint-fix: `bash scripts/lint.sh`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid AvPlat@0.0.1
15 verbose cwd /Users/avplat/Roshan/AvplatV3/avplat-v3
16 verbose Darwin 20.6.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lint-fix"
18 verbose node v14.15.5
19 verbose npm  v6.14.11
20 error code ELIFECYCLE
21 error errno 2
22 error AvPlat@0.0.1 lint-fix: `bash scripts/lint.sh`
22 error Exit status 2
23 error Failed at the AvPlat@0.0.1 lint-fix script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
0 Answers
Related