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: command not found

See original GitHub issue

Tell us about your environment

Unfortunately I can’t do eslint --env-info, because my cli says command not found I’m on a Macbook Pro 15’’ late 2013 with macOS High Sierra 10.13.6 I use SublimeText and want to get the ESLint-Formatter Plug-In up and running. But therefore I need to be able to execute eslint from command line.

  • ESLint Version: 6.8.0
  • Node Version: 11.15.0
  • npm Version: 6.9.2

What parser (default, Babel-ESLint, etc.) are you using? babel-eslint: 10.0.3

Please show your full configuration: I’m working on a vue-cli project and want to make code formatting on save happen based on linting rules. Cool.

I use nvm and my $PATH looks correct. (to me as a cli rookie atleast …) /Users/reneeschke/.nvm/versions/node/v11.15.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Configuration
{
  "name": "telekom-konfigurator",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "build:lib": "vue-cli-service build --target lib --dest ./distLIB --mode prodlib --name telekomConfigurator",
    "lint": "vue-cli-service lint --no-fix",
    "lint:fix": "vue-cli-service lint --fix"
  },
  "dependencies": {
    "babel-polyfill": "^6.26.0",
    "gsap": "^2.1.3",
    "help": "^3.0.2",
    "imports-loader": "^0.8.0",
    "jquery": "^3.4.1",
    "scrollmagic": "^2.0.7",
    "vue": "2.5.17",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.1.2",
    "@vue/cli-plugin-eslint": "^4.1.2",
    "@vue/cli-service": "^4.1.2",
    "@vue/eslint-config-airbnb": "^4.0.0",
    "babel-eslint": "^10.0.3",
    "copy-webpack-plugin": "^4.6.0",
    "eslint": "^6.8.0",
    "eslint-plugin-vue": "^6.1.2",
    "less": "^3.9.0",
    "less-loader": "^4.1.0",
    "vue-template-compiler": "2.5.17"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/recommended",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {
      "no-unused-vars": "off"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}

What did you expect to happen? I do not want to install eslint globally to solve the issue. From my research it should work with local eslint aswell, when I use eslint in my cli at project root level (where the package.json and node_modules-folder is)

I also deleted the node_modules folder and reinstalled via npm i; also removed the package-lock.json and reinstalled again.

Weirdly npm run lint (script command declared in package.json) does seem to work – atleast it logs quite a lot of errors and warnings in my project. But that doesn’t help me getting formatting on save;

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
yeonjuancommented, Jan 21, 2020

@katerlouis Hi, I want to help you 😃. How about running the command using npx?

  • example (at project root)

    $ npx eslint targetfile.js
    
0reactions
katerlouiscommented, Jan 22, 2020

Yeah I got it up and running; it couldn’t find node; i had to specify the exact path, although the notification said that it looks alright; … anyhow; what I learned: $ eslint is not supposed to work in iTerm2 in a project folder, when it’s not installed globally. Thanks guys!

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint --init Command not found · Issue #10192 - GitHub
Hi! I want to set globally the module settings for all projects. I try: npm install -g eslint. After I enter: eslint --init....
Read more >
ESlint Error Install from Command Line - Stack Overflow
For: Zsh: command not found: eslint npm install eslint-plugin-react-hooks --save --dev. then run: npm install -g eslint. It should work.
Read more >
ESLint is installed, but I encounter `bash: eslint: command not ...
Try running npx eslint -v . npx is a utility for running command-line commands from stuff you have installed in node_modules. If it...
Read more >
Fix 'eslint: command not found' in Linux | Programmer Hat
The most probable solution to fixing the “eslint: command not found” error message is to simply install the eslint command on your Linux...
Read more >
eslint/eslint - Gitter
I have a local installation of eslint, but npm doesnt seem to install it ... it will install it, but it won't make...
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