最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ESLint: 5.0.1 Error - Stack Overflow

programmeradmin0浏览0评论

I'm creating a project following this tutorial: Full Stack Web App using Vue.js & Express.js: Part 1 - Intro

I ran the next mand: "npm start" which was configured in my package.json like this:

"scripts": {
        "start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
        "lint": "./node_modules/.bin/eslint **/*.js"
      },

But ESLint throws the next error:

Oops! Something went wrong! :(

ESLint: 5.0.1. No files matching the pattern "node_modules/ipaddr.js" were found. Please check for typing mistakes in the pattern.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] lint: `eslint **/*.js` npm ERR! Exit status 2 npm ERR!  npm ERR! Failed at the [email protected] lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A plete log of this run can be found in: npm ERR!     /home/ironman/.npm/_logs/2018-06-26T13_45_13_295Z-debug.log [nodemon] process failed, unhandled exit code (2) [nodemon] Error
    at Bus.utils.bus.on (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/nodemon.js:148:25)
    at Bus.emit (events.js:187:15)
    at ChildProcess.<anonymous> (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/monitor/run.js:164:11)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

I know there is another thread asked yesterday but i can't ment on it unless i have 50 reputation. Also, joknawe points out that maybe eslint is trying to lint my node_modules directory but i don't know how to ignore it.

Is there any way to solve this issue ?

I'm creating a project following this tutorial: Full Stack Web App using Vue.js & Express.js: Part 1 - Intro

I ran the next mand: "npm start" which was configured in my package.json like this:

"scripts": {
        "start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
        "lint": "./node_modules/.bin/eslint **/*.js"
      },

But ESLint throws the next error:

Oops! Something went wrong! :(

ESLint: 5.0.1. No files matching the pattern "node_modules/ipaddr.js" were found. Please check for typing mistakes in the pattern.

npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] lint: `eslint **/*.js` npm ERR! Exit status 2 npm ERR!  npm ERR! Failed at the [email protected] lint script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A plete log of this run can be found in: npm ERR!     /home/ironman/.npm/_logs/2018-06-26T13_45_13_295Z-debug.log [nodemon] process failed, unhandled exit code (2) [nodemon] Error
    at Bus.utils.bus.on (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/nodemon.js:148:25)
    at Bus.emit (events.js:187:15)
    at ChildProcess.<anonymous> (/home/ironman/Documentos/Sandbox/Vuexpress/server/node_modules/nodemon/lib/monitor/run.js:164:11)
    at ChildProcess.emit (events.js:182:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)

I know there is another thread asked yesterday but i can't ment on it unless i have 50 reputation. Also, joknawe points out that maybe eslint is trying to lint my node_modules directory but i don't know how to ignore it.

Is there any way to solve this issue ?

Share Improve this question edited Jun 26, 2018 at 13:57 tourist 4,3337 gold badges27 silver badges48 bronze badges asked Jun 26, 2018 at 13:54 enbermudasenbermudas 1,6154 gold badges23 silver badges44 bronze badges 4
  • Create an eslint ignore file: stackoverflow./a/46947250/977192 – karllhughes Commented Jun 26, 2018 at 13:58
  • 1 I've created that file ignoring "/node_modules" but it does not work. – enbermudas Commented Jun 26, 2018 at 14:11
  • 1 @karllhughes that does not work on eslint v5 – Player1 Commented Jun 26, 2018 at 15:05
  • @EnriqueBermúdez, did you solve the issue in the end? Could you plete the tutorial? – msoutopico Commented Nov 15, 2019 at 3:38
Add a ment  | 

3 Answers 3

Reset to default 6

Below worked:

// Pass on both Windows & Ubuntu.  
// Note the slash & double quotes

// File: package.json:  

"scripts": {
  "lint": "eslint \"./**/*.js\"",
}

Below didn't work, on one of the OS:

// Windows - Fail -  "Oops! Something went wrong! :("  
// Note the single quotes

"lint": "eslint './**/*.js'",


// Ubuntu - Fail
// Note no quotes

"lint": "eslint ./**/*.js",

Hope that helps.

I've solved the exact same issue by changing

"lint": "./node_modules/.bin/eslint **/*.js"

to

"lint": "./node_modules/.bin/eslint src/*.js"

Hope this help.

I had the same issue. Worked fine under Windows, but failed during build-job (Ubuntu). Quote the pattern and it works fine as in previous versions of eslint

"lint": "./node_modules/.bin/eslint \"**/*.js\""

Credit goes to https://github./eslint/eslint/issues/10599

发布评论

评论列表(0)

  1. 暂无评论