local eslint: command not found
See original GitHub issueTell 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:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@katerlouis Hi, I want to help you 😃. How about running the command using
npx
?example (at project root)
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!