Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

370
Views
Express.js + lint da error

https://www.youtube.com/watch?v=Fa4cRMaTDUI Estoy viendo esta lección y tratando de recrear todo lo que hace el autor. A las 19:00 establece el proyecto vue.js-express.js. Crea una carpeta llamada 'servidor'. En 'servidor/' ejecuta 'npm init -f'. Luego 'npm install --save nodemon eslint', luego inicia su eslint. Luego, en el archivo package.json, escribe:

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

Luego, en la carpeta 'servidor', crea la carpeta 'src'. En 'src' crea 'app.js'. Y en 'app.js; hay un simple console.log('hola'). Luego ejecuta 'npm start'. 'Hola' está impreso en la terminal, nodemon y eslint funcionan bien. Luego escribe 'npm install --save express'. Ahí empieza mi problema. Después de instalar express.js, escribo 'npm start' y aparece este error en la terminal:

 Oops! Something went wrong! :( ESLint: 5.0.0. 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! server@1.0.0 lint: `eslint **/*.js` npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the server@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/r/.npm/_logs/2018-06-25T10_32_02_027Z-debug.log [nodemon] process failed, unhandled exit code (2) [nodemon] Error at Bus.utils.bus.on (/home/r/projects/tab-tracker/server/node_modules /nodemon/lib/nodemon.js:148:25) at Bus.emit (events.js:164:20) at ChildProcess.<anonymous> (/home/r/projects/tab-tracker/server/node_modules/nodemon/lib/monitor/run.js:164:11) at ChildProcess.emit (events.js:159:13) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)

¿Por qué está pasando esto?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Cita el patrón y funciona bien como en versiones anteriores de eslint

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

El crédito va a https://github.com/eslint/eslint/issues/10599

over 4 years ago · Santiago Trujillo Report

0

@joknawe en los comentarios dio la respuesta correcta, gracias. editar:

Parece que tal vez está tratando de borrar su directorio node_modules. Esto debe ignorarse de forma predeterminada, pero su comodín **/*.js puede estar causando el problema. Intenta usar solo eslint

over 4 years ago · Santiago Trujillo Report

0

Uso WSL y lo arreglé cambiando la siguiente línea.

Anterior

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

Después

 "start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'", "lint": "./node_modules/.bin/eslint src/**/*.js --fix"
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!