【发布时间】:2015-09-29 07:29:50
【问题描述】:
我在完成 TeamCity 配置的最后一部分时遇到了严重问题。
我有一个执行以下命令的 powershell 步骤:
& npm install
& grunt build
记录以下输出:
Build (Powershell) (1s)
[13:18:08]PowerShell Executable: C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
[13:18:08]Working directory: C:\BuildAgent\work\6a434ee5d01fd0d9
[13:18:08]PowerShell arguments: [-NonInteractive, -ExecutionPolicy, ByPass, -File, C:\BuildAgent\temp\buildTmp\powershell8407335260182621582.ps1]
[13:18:09]Error: ENOENT, stat 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
[13:18:09]
[13:18:09]grunt-cli: The grunt command line interface. (v0.1.13)
[13:18:09]Process exited with code 0
我 seen 认为这是 known 问题,但到目前为止,solutions 都没有为我工作。
我的设置如下:我在 Azure 中有两台虚拟机,build 和 agent。两者都连接到同一个 AD 域 domain,其中有一个用户 domain\teamcityuser,他是“标准”类(即不是管理员)。该用户同时运行构建服务器(在build 实例上)和构建代理(在agent 实例上)。
我尝试了这些方法但没有成功:
- 在错误消息中创建目录,确保
domain\teamcityuser对其具有完全控制访问权限。 - 在
C:\Users\teamcityuser\AppData\Roaming下创建npm目录 - 使用内容
prefix=C:\npm-global创建文件C:\Windows\System32\config\SystemProfile\.npmrc,以及创建后一个文件夹 - 在运行构建之前运行
npm cache clean - 通过
npm install -g npm安装全局npm包
我还可以尝试什么来使它正常工作?
为了避免the XY problem,这是我的实际问题:
我有一个 .NET Web API 项目,通过此 TeamCity 安装、Octopus Deploy 和托管服务器进行 CI 设置。我还有一个 github 存储库,其中包含将使用 API 的 Web SPA 的代码。 spa 是用grunt build 构建的,之后有一个dist 文件夹,其中包含我需要部署的所有内容。
我也想尽可能多地重复使用 CI 架构来推出客户端。
【问题讨论】:
-
您是否尝试在系统配置文件下创建
npm文件夹?C:\Windows\sysWOW64\config\systemprofile\AppData\Roaming\npm
标签: powershell azure npm teamcity teamcity-9.1