【问题标题】:Build IONIC on TEAMCITY failed在 TEAMCITY 上构建 IONIC 失败
【发布时间】:2019-06-28 02:31:42
【问题描述】:

在我自己的 TEAMCITY 服务器实例上,我想构建一个 Ionic 的 Android 应用程序。

Teamcity : 在 Windows 服务器上, 我在 Powershell 上的构建步骤:

npm install
ionic cordova build android

结果:IONIC 没有被识别为命令

[11:44:19]  [Step 1/1] ionic : Le terme ®ionic¯ n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme 
[11:44:19]  [Step 1/1] 
[11:44:19]  [Step 1/1] 
[11:44:19]  [Step 1/1] ex‚cutable. V‚rifiez l'orthographe du nom, ou si un chemin d'accŠs existe, v‚rifiez que le chemin d'accŠs est correct 
[11:44:19]  [Step 1/1] et r‚essayez.
[11:44:19]  [Step 1/1] Au caractŠre C:\TeamCity\buildAgent\temp\buildTmp\powershell3528430019226856505.ps1:4 : 1
[11:44:19]  [Step 1/1] + ionic cordova build android
[11:44:19]  [Step 1/1] + ~~~~~
[11:44:19]  [Step 1/1]     + CategoryInfo          : ObjectNotFound: (ionic:String) [], CommandNotFoundException
[11:44:19]  [Step 1/1]     + FullyQualifiedErrorId : CommandNotFoundException
[11:44:19]  [Step 1/1]  
[11:44:19]  [Step 1/1] Process exited with code 0

如果我直接在同一目录中的 powershell 控制台中运行相同的脚本,它就可以工作。

我尝试了很多方法,但仍然有同样的问题。

【问题讨论】:

  • TeamCity 构建代理在哪个用户下运行?它是系统帐户之一还是普通用户帐户?您能否以该用户身份运行命令提示符,然后再次尝试运行该命令?

标签: typescript ionic-framework build continuous-integration teamcity


【解决方案1】:

我找到了解决方案:我在管理员上以 powershell 模式运行。 Powershell 构建代理在“沙箱”中运行,我完成了读取本地 node_module 的路径:

$currentPath = Convert-Path '.\node_modules\.bin\'
$env:Path += ";" + $currentPath

【讨论】:

    猜你喜欢
    • 2020-01-19
    • 2019-03-15
    • 1970-01-01
    • 2016-10-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多