【问题标题】:TFS (on premise) build output shown with wrong character-encodingTFS(本地)构建输出显示错误的字符编码
【发布时间】:2016-09-09 13:23:32
【问题描述】:

我们有 TFS2015 和构建定义,如下所示:

当我触发构建时,我得到的输出字符编码错误:

2016-09-07T11:40:29.2722404Z ΓööΓöÇΓöÇ readable-stream@2.1.5 (buffer-shims@1.0.0, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.2, util-deprecate@1.0.2, process-nextick-args@1.0.7, isarray@1.0.0)     
2016-09-07T11:40:29.2722404Z run-sequence@1.2.2 node_modules\run-sequence     
2016-09-07T11:40:29.2722404Z ΓööΓöÇΓöÇ chalk@1.1.3 (supports-color@2.0.0, escape-string-regexp@1.0.5, ansi-styles@2.2.1, strip-ansi@3.0.1, has-ansi@2.0.0)     
2016-09-07T11:40:29.2722404Z vinyl-source-stream@1.1.0 node_modules\vinyl-source-stream     
2016-09-07T11:40:29.2722404Z Γö£ΓöÇΓöÇ vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)     
2016-09-07T11:40:29.2722404Z ΓööΓöÇΓöÇ through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.34)     
2016-09-07T11:40:29.2722404Z gulp-concat@2.6.0 node_modules\gulp-concat     
2016-09-07T11:40:29.2762404Z Γö£ΓöÇΓöÇ concat-with-sourcemaps@1.0.4 (source-map@0.5.6)     
2016-09-07T11:40:29.2762404Z ΓööΓöÇΓöÇ through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.34)     
2016-09-07T11:40:29.2762404Z vinyl-buffer@1.0.0 node_modules\vinyl-buffer     
2016-09-07T11:40:29.2762404Z Γö£ΓöÇΓöÇ through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.34)

知道怎么解决吗?


编辑:当我登录到构建服务器虚拟机并从命令提示符运行 npm install 时,我得到正确的输出:

run-sequence@1.2.2 node_modules\run-sequence
└── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.1)

merge-stream@1.0.0 node_modules\merge-stream
└── readable-stream@2.1.5 (inherits@2.0.3, buffer-shims@1.0.0, string_decoder@0.10.31, process-nextick-args@1.0.7, util-deprecate@1.0.2, core-util-is@1.0.2, isarray@1.0.0)

vinyl-source-stream@1.1.0 node_modules\vinyl-source-stream
├── vinyl@0.4.6 (clone-stats@0.0.1, clone@0.2.0)
└── through2@0.6.5 (xtend@4.0.1, readable-stream@1.0.34)

开发机器环境:

OS Name:                   Microsoft Windows 10 Enterprise
Active code page:          437 (both build server and dev machine)
System Locale:             sk;Slovak
Node version:              5.10.1
NPM version:               3.8.5

构建服务器环境

OS Name:                   Microsoft Windows Server 2012 R2 Standard
Active code page:          437 (both build server and dev machine)
System Locale:             en-us;English (United States)
Node version:              5.10.1
NPM version:               3.8.5

TFS 版本是 14.102.25423.0(更新 3),但它位于另一台服务器上,我无权访问。我只看到门户网站。

重现步骤:

  1. npm 初始化
  2. npm install run-sequence --save-dev
  3. 推送到 TFS Git 存储库
  4. 单步创建构建定义:npm install
  5. 排队新构建

【问题讨论】:

  • npm 的版本是多少?
  • 好的,我将 NPM 升级到 5.10.1 后,它开始工作了。以前安装了当前 LTS 版本 (4.x)

标签: node.js tfs character-encoding tfsbuild tfs-2015


【解决方案1】:

由于您提到它在从命令提示符运行 npm install 时有效,您还可以在构建定义中添加“命令行”任务来运行 npm install 命令。

【讨论】:

    【解决方案2】:

    我在构建中尝试了 gulp imagemin 任务,但无法在我这边重现您的问题。为了缩小问题范围,请检查:

    1. TFS 2015 是否已升级到最新版本 Update 3。
    2. 检查 npm 是否是构建服务器上的最新版本。
    3. 在构建代理服务器上手动运行 gulp 任务以查看问题是否可以重现。
    4. 如果以上选项都不起作用,请分享您的构建任务的详细设置,我想设置一个相同的环境来检查您的问题是否可以重现。

    【讨论】:

    • 有关详细信息,请参阅我的编辑。不是 gulp 任务,而是 npm install,其输出显示不正确。
    • 不是 100% 确定,但升级 NPM 可能会解决它。
    猜你喜欢
    • 2023-03-16
    • 2017-05-08
    • 2013-08-23
    • 1970-01-01
    • 1970-01-01
    • 2015-01-28
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多