gpt4 book ai didi

javascript - ESLint:5.0.1 错误

转载 作者:行者123 更新时间:2023-11-30 06:24:58 31 4
gpt4 key购买 nike

我正在按照本教程创建一个项目:Full Stack Web App using Vue.js & Express.js: Part 1 - Intro

我运行了下一个命令:“npm start”,它在我的 package.json 中配置如下:

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

但是 ESLint 抛出下一个错误:

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! 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/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)

我知道有 another thread昨天问,但除非我有 50 的声誉,否则我不能对此发表评论。另外,joknawe指出也许 eslint 正在尝试检查我的 node_modules 目录,但我不知道如何忽略它。

有什么办法可以解决这个问题吗?

最佳答案

以下工作:

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

// File: package.json:

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

以下在其中一个操作系统上不起作用:

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

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


// Ubuntu - Fail
// Note no quotes

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

希望对您有所帮助。

关于javascript - ESLint:5.0.1 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51044624/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com