我遇到了严重的问题,我的TeamCity配置的最后部分到位。TeamCity与npm - 错误:ENOENT,stat'C: Windows system32 config systemprofile AppData Roaming npm'
我有一个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
目录通过npm install -g npm
C:\Windows\System32\config\SystemProfile\.npmrc
与内容
prefix=C:\npm-global
,以及创建后的文件夹
npm
包之前运行npm cache clean
还有什么可以尝试使这个工作?
,避免the XY problem,这里是我的实际问题:
我有通过这个TeamCity的安装CI设置一个.NET的Web API项目,通过章鱼部署和托管服务器。我还有一个github repo,其代码将用于将使用API的web SPA。水疗中心使用grunt build
构建,之后有一个dist
文件夹,其中包含我需要部署的所有内容。
我想尽可能多地重复使用CI架构来推出客户端。
您是否尝试在系统配置文件下创建'npm'文件夹? 'C:\ Windows \ sysWOW64 \ config \ systemprofile \ AppData \ Roaming \ npm' – Vesper