nuxt / create-nuxt-app

Create Nuxt.js App in seconds.
MIT License
3.48k stars 429 forks source link

feat(deps): typescript and eslint run lint failure. (nuxt#916) #924

Closed kouhei closed 2 years ago

kouhei commented 2 years ago

Types of changes

Description

Resolves: #916 This change solves application first commit fails lint in CI.

Checklist:

kouhei commented 2 years ago

@clarkdo thank you for your comment. there are steps to reproduce it.

  1. run npx create-nuxt-app with below options
    language: TypeScript
    Package manager: Npm
    Linting tools: ESLint
    Testing framework: Jest
    Rendering mode: Universal (SSR / SSG)
    Deployment target: Static (Static/Jamstack hosting)
    CI: GitHub Actions (GitHub only)
  2. commit these & push to github.
  3. CI failed with below error
> eslint --ext ".js,.ts,.vue" --ignore-path .gitignore .

Oops! Something went wrong! :(

ESLint: 8.7.0

Error: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.js » @nuxtjs/eslint-config-typescript': Cannot find module 'typescript'
Require stack:
- /home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js
- /home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js
- /home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js
- /home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js
- /home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
- /home/runner/work/test3/test3/node_modules/@eslint/eslintrc/dist/eslintrc.cjs
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (/home/runner/work/test3/test3/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/runner/work/test3/test3/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js:27:25)
    at Module._compile (/home/runner/work/test3/test3/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test3@1.0.0 lint:js: `eslint --ext ".js,.ts,.vue" --ignore-path .gitignore .`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the test3@1.0.0 lint:js script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-01-20T13_20_50_557Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! test3@1.0.0 lint: `npm run lint:js && npm run lint:style && npm run lint:prettier`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the test3@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/runner/.npm/_logs/2022-01-20T13_20_50_856Z-debug.log
Error: Process completed with exit code 2.
kouhei commented 2 years ago

I found the cause. It was because node version is different between CI(14.18.3) and local(16.13.0). this is my mistake. I'm sorry.