https://www.youtube.com/watch?v=Fa4cRMaTDUI

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

然后在文件夹"server"中创建文件夹"src".在"src"中,他创建了"app".js'.在应用程序中.js;有一个简单的控制台.日志(log)("你好").

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)

为什么会这样?

推荐答案

@joknawe在 comments 中给出了正确的答案,谢谢.

看起来它可能正试图删除你的node_modules目录.默认情况下,这应该被忽略,但您的通配符**/*.js可能是问题的根源.try 使用eslint

Vue.js相关问答推荐

我可以手动访问 vue-router 解析器吗?

如何只提取一次用于无线电组过滤的数据,而不是针对数据库中的每个条目提取数据?

Vuetify 3 v-radio-group 将模型设置为 null

视图中的 vue 样式不适用于 html

在 VueJS 中为 Get、Post、Patch 配置全局标头的最佳方法

VueJS中的绑定函数含义

在 VueJS 中存储图像的正确位置是什么 - 公共文件夹或assets文件夹?

为什么在 Vue.js 中使用 `var` 关键字?

vuetifyjs:仅添加使用过的图标来构建

Vuejs中的条件a href

VueJS:向左,元素的顶部位置?

Polyfill for ie

如何在 vue 3 脚本设置中使用

Django Rest 框架、CSRF 和 Vue.js

React.js 是否有类似 Vue.js

全局禁用 vuetify 组件的涟漪效应

如何从 vue.js 捕获 Jquery 事件

使用 Firebase Auth for Google 将匿名用户转换为注册用户

何时使用

IOS在输入焦点上显示键盘