【发布时间】:2018-07-13 13:05:01
【问题描述】:
我意识到这很可能是一个重复的问题。我是 nodemon 的新手,我正在尝试使用 nodemon 为 Vue JS 项目建立服务器。我正在尝试使用 nodemon 运行 eslint,但无法弄清楚为什么我不断收到错误消息。如果我在 --exec 之后删除 npm,它会告诉我 ''run' 无法识别,如果我删除它,我会得到 ''lint' 无法识别等等。 我的 package.json 文件:
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon src/app.js --exec 'npm run lint && node'",
"lint": "eslint **/*.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"eslint": "^4.16.0",
"nodemon": "^1.14.12"
}
}
我也在我的启动脚本中尝试过这段代码:
"scripts" : {
"start": "./node_modules/nodemon/bin/nodemon.js src/app.js --exec 'npm run lint && node'",
"lint": "./nodemodules/.bin/eslint **/*.js"
}
在哪里告诉我“。”不被识别为内部外部命令。 我已将 nodemon 安装到我的服务器文件夹和项目目录以及全局中。我也对 eslint 做了同样的事情。
【问题讨论】: