AndreaPontrandolfo / sheriff

A comprehensive and opinionated Typescript-first ESLint configuration.
https://www.eslint-config-sheriff.dev
MIT License
106 stars 7 forks source link

Installation error #139

Closed seebeen closed 5 months ago

seebeen commented 5 months ago

Empty project - only typescript as a dependency.

❯ npx create-sheriff-config

✔ Do you want to use the eslint-ts-patch?
Yes
◐ Neither a eslint.config.ts nor a eslint.config.js file were found. Generating and configuring eslint.config.ts file...                                                                                                                                                                                                                         2:13:21 PM

 WARN  If you have other ESLint configs in your project, remove them                                                                                                                                                                                                                                                                             2:13:21 PM

ℹ Setting Sheriff with options:                                                                                                                                                                                                                                                                                                                 2:13:21 PM

 ╭──────────────────────────────────────────────╮
 │                                              │
 │  {                                           │
 │    "react": false,                           │
 │    "lodash": false,                          │
 │    "next": false,                            │
 │    "playwright": false,                      │
 │    "jest": false,                            │
 │    "vitest": false                           │
 │  }                                           │
 │                                              │
 ╰──────────────────────────────────────────────╯

✔ Successfully generated eslint.config.ts file                                                                                                                                                                                                                                                                                                  2:13:21 PM
◐ No 'prettier' configuration or dependency was found in the project. Generating and configuring .prettierrc.json file...                                                                                                                                                                                                                        2:13:21 PM
✔ Successfully generated .prettierrc.json file                                                                                                                                                                                                                                                                                                  2:13:21 PM
◐ No .prettierignore file was found in the project. Generating and configuring .prettierignore file...                                                                                                                                                                                                                                           2:13:21 PM
◐ Installing 'eslint'...                                                                                                                                                                                                                                                                                                                         2:13:21 PM
◐ Installing 'eslint-define-config'...                                                                                                                                                                                                                                                                                                           2:13:21 PM
◐ Installing 'eslint-config-sheriff'...                                                                                                                                                                                                                                                                                                          2:13:21 PM
◐ Installing 'eslint-ts-patch'...                                                                                                                                                                                                                                                                                                                2:13:21 PM
◐ Installing '@sherifforg/types'...                                                                                                                                                                                                                                                                                                              2:13:21 PM
✔ Successfully generated .prettierignore file                                                                                                                                                                                                                                                                                                   2:13:21 PM
ℹ Detected package manager: npm                                                                                                                                                                                                                                                                                                                 2:13:21 PM
◐ Installing dependendencies...                                                                                                                                                                                                                                                                                                                  2:13:21 PM
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: undefined@undefined
npm ERR! Found: eslint@9.2.0
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"9.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@">=8.23.0 <=8.57.0" from eslint-config-sheriff@18.3.0
npm ERR! node_modules/eslint-config-sheriff
npm ERR!   dev eslint-config-sheriff@"18.3.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /home/venom/.npm/_logs/2024-05-04T12_13_21_669Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /home/venom/.npm/_logs/2024-05-04T12_13_21_669Z-debug-0.log

 ERROR  Couldn't auto-install the required packages.                                                                                                                                                                                                                                                                                             2:13:23 PM
      You have to install them manually yourself.
      Please try to run: npm add -D eslint@latest eslint-define-config@latest eslint-config-sheriff@latest eslint-ts-patch@latest eslint@npm:eslint-ts-patch@latest @sherifforg/types@latest

 ERROR  Couldn't walk up the filesystem                                                                                                                                                                                                                                                                                                          2:13:23 PM

file:///home/venom/.npm/_npx/1cf4107118993e1f/node_modules/create-sheriff-config/dist/index.js:25
    throw new Error(isString(error) ? error : String(error));
          ^

Error: Error: Error: Command failed with exit code 1: npm install -D eslint@latest eslint-define-config@latest eslint-config-sheriff@latest eslint-ts-patch@latest eslint@npm:eslint-ts-patch@latest @sherifforg/types@latest
    at throwError (file:///home/venom/.npm/_npx/1cf4107118993e1f/node_modules/create-sheriff-config/dist/index.js:25:11)
    at autoInstallPackages (file:///home/venom/.npm/_npx/1cf4107118993e1f/node_modules/create-sheriff-config/dist/index.js:100:5)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async setDependencies (file:///home/venom/.npm/_npx/1cf4107118993e1f/node_modules/create-sheriff-config/dist/index.js:126:3)
    at async main (file:///home/venom/.npm/_npx/1cf4107118993e1f/node_modules/create-sheriff-config/dist/index.js:521:3)
AndreaPontrandolfo commented 5 months ago

Sorry i still didn't update the CLI to NOT install ESlint 9, which is currently not compatible with Sheriff. I mean to do it soon, though. Anyway, just install the packages with the suggested command. But instead of installing eslint@latest, install eslint@8.57.0. I will get a closer look at the npm installs though (i use exclusively pnpm), thank you for the report.

AndreaPontrandolfo commented 5 months ago

Fixed with https://github.com/AndreaPontrandolfo/sheriff/pull/138/commits/ebdfae093338fe12f681ed2507f44ed91d80f8b2 and https://github.com/AndreaPontrandolfo/sheriff/pull/141