question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

local eslint on windows error

See original GitHub issue

everytime I do npm run eslint I get the error below. However the linting process completes. I don’t have es-lint globally installed could this be why?

eslint version: 3.8.1 node version - 5.4.0 npm version - 3.3.12

.eslintrc.js

module.exports = {
    "extends": "airbnb",
    "plugins": [
        "react",
        "jsx-a11y",
        "import"
    ],
    "env": {
        "browser": true
    },
    "rules": {
        "no-console": 0,
        "no-unused-vars": 0,
        "linebreak-style": 0
    }
};

Package.json


{
  "name": "es6",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "eslint": "./node_modules/.bin/eslint app.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "eslint": "^3.8.1",
    "eslint-config-airbnb": "^12.0.0",
    "eslint-plugin-import": "^2.0.1",
    "eslint-plugin-jsx-a11y": "^2.2.3",
    "eslint-plugin-react": "^6.4.1"
  }
}

npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "eslint"
npm ERR! node v5.4.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! es6@1.0.0 eslint: `eslint app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the es6@1.0.0 eslint script 'eslint app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the es6 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint app.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls es6
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     c:\local\ES2015\npm-debug.log

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
stsiarzhanaucommented, Jan 14, 2017

I have the same issue as @amarbham. As the OP is unresponsive I will answer above mentioned questions.

Q. Does npm run eslint output anything other than what you pasted above? A. Yes, I have standard eslint output (lint warnings, errors, etc.) before npm error info.

Q. What happens if you just use ./node_modules/.bin/eslint app.js manually? A. Exactly the same (standard eslint output, then npm error).

Additional info:

  1. If my code doesn’t contain errors (but have warnings) I see standard eslint output with warnings and NO npm error info.
  2. If I use eslint with eslint-watch in watch mode I have standard output (lint warnings, errors, etc.) after each file save and NO npm error info.
  3. Wheather I have eslint installed both globally and in devDependencies or just in devDependencies doesn’t matter.

Versions: Windows_NT 10.0.14393 node v6.9.1 npm v3.10.8 eslint v3.13.1 eslint-watch v2.1.14 (optionally)

I tried to run npm scripts using cmder, gitBash, Windows PowerShel and standard Windows console. No difference.

So, please, re-open this issue. I also suggest to rename the issue to something like this: “npm throws an error after ESLint task is completed (on Windows)”

P.S. Output in debug mode:

npm run lint

react-redux-starter-kit@1.0.0 lint C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit
eslint src --color --debug

  eslint:cli Running on files +0ms
  eslint:glob-util Creating list of files to process. +30ms
  eslint:ignored-paths Looking for ignore file in C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit +2ms
  eslint:ignored-paths Could not find ignore file in cwd +0ms
  eslint:cli-engine Processing C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\App.js +0ms
  eslint:cli-engine Linting C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\App.js +0ms
  eslint:config Constructing config for C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\App.js +0ms
  eslint:config Using .eslintrc and package.json files +0ms
  eslint:config Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\.eslintrc.js +0ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\.eslintrc.js +0ms
  eslint:config-file Loading airbnb +215ms
  eslint:config-file Attempting to resolve eslint-config-airbnb +0ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb\index.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb\rules\react-a11y.js +16ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb\rules\react-a11y.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb\rules\react.js +0ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb\rules\react.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\strict.js +16ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\strict.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\index.js +15ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\index.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\imports.js +0ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\imports.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\es6.js +0ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\es6.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\variables.js +38ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\variables.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\style.js +16ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\style.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\node.js +115ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\node.js +1ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\errors.js +3ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\errors.js +0ms
  eslint:config-file Loading C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\best-practices.js +15ms
  eslint:config-file Loading JS config file: C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\node_modules\eslint-config-airbnb-base\rules\best-practices.js +0ms
  eslint:config Using C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\.eslintrc.js +47ms
  eslint:config Merging command line environment settings +16ms
  eslint:config-ops Apply environment settings to config +0ms
  eslint:config-ops Creating config for environment node +0ms
  eslint:config-ops Creating config for environment es6 +0ms
  eslint:config-ops Creating config for environment browser +0ms
  eslint:config-ops Creating config for environment mocha +0ms
  eslint:cli-engine Processing C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Counter.js +119ms
  eslint:cli-engine Linting C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Counter.js +0ms
  eslint:config Constructing config for C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Counter.js +0ms
  eslint:config Using config from cache +0ms
  eslint:cli-engine Processing C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\index.js +34ms
  eslint:cli-engine Linting C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\index.js +0ms
  eslint:config Constructing config for C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\index.js +0ms
  eslint:config Using config from cache +0ms
  eslint:cli-engine Processing C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Layout.js +32ms
  eslint:cli-engine Linting C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Layout.js +15ms
  eslint:config Constructing config for C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Layout.js +0ms
  eslint:config Using config from cache +0ms
  eslint:cli-engine Linting complete in: 732ms +16ms

C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\src\Layout.js
  3:1  warning  Unexpected console statement                                     no-console
  5:1  error    All 'var' declarations must be at the top of the function scope  vars-on-top
  5:1  error    Unexpected var, use let or const instead                         no-var
  5:5  error    'a' is defined but never used                                    no-unused-vars
  6:1  error    All 'var' declarations must be at the top of the function scope  vars-on-top
  6:1  error    Unexpected var, use let or const instead                         no-var
  6:5  error    'b' is defined but never used                                    no-unused-vars
  7:1  error    All 'var' declarations must be at the top of the function scope  vars-on-top
  7:1  error    Unexpected var, use let or const instead                         no-var
  7:5  error    'c' is defined but never used                                    no-unused-vars

✖ 10 problems (9 errors, 1 warning)


npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! react-redux-starter-kit@1.0.0 lint: `eslint src --color --debug`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-redux-starter-kit@1.0.0 lint script 'eslint src --color --debug'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-redux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     eslint src --color --debug
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs react-redux-starter-kit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls react-redux-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\OpenServer\domains\EXAMPLES\react-redux-starter-kit\npm-debug.log
1reaction
eslintbotcommented, Oct 19, 2016

Hi @amarbham, thanks for the issue. It looks like there’s not enough information for us to know how to help you.

If you’re reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

Requesting a rule change? Please see Proposing a Rule Change for instructions.

If it’s something else, please just provide as much additional information as possible. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint not working in VS Code?
If ESLint is running in the terminal but not inside VSCode, it is probably because the extension is unable to detect both the...
Read more >
eslint is not using local config · Issue #636
I have eslint installed globally and locally. However, the vscode plugin is not respecting the local configuration files.
Read more >
Local Install of ESLint Breaks In-Editor Linting
From the command line run npm install eslint. Confirm in package. json/package-lock. json that eslint has been installed locally as a dependency.
Read more >
ESLint not working in VSCode? Help build a ...
Open the command palette by pressing Ctrl / Cmd + Shift + P and select 'ESLint: Show Output Channel'. If ESLint throws any...
Read more >
Command Line Interface
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found