在我自己的 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 控制台中运行相同的脚本,它就可以工作。
我尝试了很多方法,但仍然有同样的问题。
我找到了解决方案:我在管理员模式下以 powershell 模式运行。Powershell 构建代理在“沙箱”中运行,我完成了读取本地 node_module 的路径:
$currentPath = Convert-Path '.\node_modules\.bin\'
$env:Path += ";" + $currentPath
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句