Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript and ESLint run lint failure. #916

Open
aloulouamine opened this issue Dec 12, 2021 · 1 comment
Open

Typescript and ESLint run lint failure. #916

aloulouamine opened this issue Dec 12, 2021 · 1 comment
Labels

Comments

@aloulouamine
Copy link

Version

create-nuxt-app: v3.7.1

Steps to reproduce

Create a new nuxt (typescript, es-lint) application:
npx create-nuxt-app my-first-nuxt-app

What is Expected?

Application first commit should successfully lint in CI.

What is actually happening?

When running npm run lint ESLint there is no typescript installed dependency:

Run npm run lint
  npm run lint
  shell: /usr/bin/bash -e {0}

> hands-on-nuxt@1.0.0 lint /home/runner/work/hands-on-nuxt/hands-on-nuxt
> npm run lint:js && npm run lint:style


> hands-on-nuxt@1.0.0 lint:js /home/runner/work/hands-on-nuxt/hands-on-nuxt
> eslint --ext ".js,.vue" --ignore-path .gitignore .


Oops! Something went wrong! :(

ESLint: 7.32.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/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/rules/adjacent-overload-signatures.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/rules/index.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/index.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@eslint/eslintrc/lib/config-array-factory.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@eslint/eslintrc/lib/index.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/eslint/lib/cli-engine/cli-engine.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/eslint/lib/eslint/eslint.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/eslint/lib/eslint/index.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/eslint/lib/cli.js
- /home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/eslint/bin/eslint.js
    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/hands-on-nuxt/hands-on-nuxt/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
    at Object.<anonymous> (/home/runner/work/hands-on-nuxt/hands-on-nuxt/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js:27:25)
    at Module._compile (/home/runner/work/hands-on-nuxt/hands-on-nuxt/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! hands-on-nuxt@1.0.0 lint:js: `eslint --ext ".js,.vue" --ignore-path .gitignore .`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the hands-on-nuxt@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/2021-12-12T20_00_10_846Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! hands-on-nuxt@1.0.0 lint: `npm run lint:js && npm run lint:style`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the hands-on-nuxt@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/2021-12-12T20_00_10_970Z-debug.log
Error: Process completed with exit code 2.
@kouhei
Copy link

kouhei commented Jan 20, 2022

I had same issue.
In my case, it was because node version is different between CI(14.18.3) and local(16.13.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants