我有一个名为 eslint:jenkins
的 Grunt 任务,它在项目上运行 eslint。在构建管道中,我将其运行为:
grunt eslint:jenkins --force --verbose
我使用 --force 这样即使任务失败,grunt 也不会失败,因为存在一些 eslint 问题。
当我在本地运行时一切正常。当它在 Jenkins 上运行时,我收到以下错误:
<path-to-installation>/Node_10/bin/node: bad option: --force
对于本地和 Jenkins 环境,版本是:Node 10.0 和 grunt-cli 1.3.1。
我无法想象为什么在一种情况下 --force
标志会传播到 Node。谁能给我一些关于在哪里看的指示?
最佳答案
与 Node 10 和带参数的 gulp 任务相同的问题。
./node_modules/.bin/gulp tasks:my-task --myoption=value
[16:14:24] Node flags detected: --myoption=value
[16:14:24] Respawned to PID: 21231
Node 8 没有问题。没有尝试使用 Node 9。一定是某处发生了重大变化,但我可以在这个问题和 https://github.com/gulpjs/gulp/issues/1564 旁边找到任何相关信息。
关于node.js - Grunt --force 失败, Node 为 : bad option,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52150323/