Cli: [BUG] npm运行脚本--silent现在已完全损坏

创建于 2020-10-23  ·  3评论  ·  资料来源: npm/cli

注意:问题https://github.com/npm/cli/issues/1958指的是--silent禁止所有输出。

当前行为:


npm run --silent script现在输出所有内容,例如:

$ npm run --silent checksum 

> @cliff/[email protected] checksum
> cat *coffee | cksum | cut -d' ' -f1

3115970741

换句话说, --silent标志什么都不做。

预期行为:

$ npm --version
6.14.8
$ npm run --silent checksum
3115970741

重现步骤:

看上面。

环境:

  • 作业系统:Ubuntu 20.04.1
  • 节点:v15.0.1
  • npm:v7.0.3
Bug Needs Triage Release 7.x

所有3条评论

我们面临着同样的问题。 在Jenkins中,我们使用npm run -s cmd来检索一些信息,此错误完全破坏了我们的管道。

@CliffS标题中有一个错字: s/rpm run-script/npm run-script/您介意解决吗? 🙇

发布了npm 7.0.7,对其进行了修复:

root<strong i="6">@e8ca26fa92e7</strong>:~/t1# npm version
{
  t1: '1.0.0',
  npm: '7.0.3',
  node: '15.0.1',
  v8: '8.6.395.17-node.15',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.16.1',
  modules: '88',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1g',
  cldr: '37.0',
  icu: '67.1',
  tz: '2020a',
  unicode: '13.0'
}
root<strong i="7">@e8ca26fa92e7</strong>:~/t1# npm test -s

> [email protected] test
> echo "Error: no test specified" && exit 1

Error: no test specified
root<strong i="8">@e8ca26fa92e7</strong>:~/t1# npm i -g [email protected]

changed 1 package, and audited 248 packages in 3s

10 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
root<strong i="9">@e8ca26fa92e7</strong>:~/t1# npm version
{
  t1: '1.0.0',
  npm: '7.0.7',
  node: '15.0.1',
  v8: '8.6.395.17-node.15',
  uv: '1.40.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.16.1',
  modules: '88',
  nghttp2: '1.41.0',
  napi: '7',
  llhttp: '2.1.3',
  openssl: '1.1.1g',
  cldr: '37.0',
  icu: '67.1',
  tz: '2020a',
  unicode: '13.0'
}
root<strong i="10">@e8ca26fa92e7</strong>:~/t1# npm test -s
Error: no test specified
root<strong i="11">@e8ca26fa92e7</strong>:~/t1#

我认为我们可以解决这个问题

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

millerick picture millerick  ·  3评论

1000i100 picture 1000i100  ·  3评论

admosity picture admosity  ·  4评论

FaizenR picture FaizenR  ·  3评论

zypA13510 picture zypA13510  ·  4评论