TeamCity的与NPM - 错误:ENOENT,STAT'C:\\ WINDOWS \\ system32 \\设置\\ systemprofile \\应用程序数据\\漫游\\ NPM“ [英] TeamCity with npm - Error: ENOENT, stat 'C:\Windows\system32\config\systemprofile\AppData\Roaming\npm'
问题描述
我有严重的问题,让我的TeamCity配置的最后一个碎片。
I'm having serious problems getting the last pieces of my TeamCity configuration in place.
我有一个PowerShell的步骤,执行下面的命令:
I have a powershell step that executes the following commands:
& npm install
& grunt build
日志的输出如下:
logging the following output:
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
我已经看到,这是一个<一个href=\"http://stackoverflow.com/questions/25093276/node-js-windows-error-enoent-stat-c-users-rt-appdata-roaming-npm\">known的问题,但没有一种<一href=\"https://github.com/npm/npm/wiki/Troubleshooting#error-enoent-stat-cusersuserappdataroamingnpm-on-windows-7\"相对=nofollow> 为我迄今为止的工作方案。
I've seen that this is a known problem, but none of the solutions has worked for me so far.
我的设置是这样的:我有两个虚拟机在Azure中,建立
和剂
。两者都连接到相同的AD域,域
,其中有域\\ teamcityuser
,是谁的用户标准级(即不是管理员)。该用户同时运行构建服务器(在建立
实例),并生成代理(在剂
实例)。
My setup is the following: I have two virtual machines in Azure, build
and agent
. Both are connected to the same AD domain, domain
, in which there is a user domain\teamcityuser
, who is of "standard" class (i.e. not admin). This user runs both the build server (on the build
instance) and the build agent (on the agent
instance).
我试过这些东西都没有成功:
I've tried these things without success:
- 创建错误消息的目录,确保
域\\ teamcityuser
具有完全控制研究访问权限了。 - 在
ç创建
NPM
目录:\\用户\\ teamcityuser \\应用程序数据\\漫游 - 创建一个文件
C:\\ WINDOWS \\ system32 \\设置\\ SystemProfile \\ .npmrc
的内容preFIX = C:\\ NPM -global
,以及创建后者文件夹 - 运行
NPM缓存清理
运行构建之前 - 到
安装一个全球性的
NPM
包安装NPM NPM -g
- Creating the directory in the error message, making sure that
domain\teamcityuser
has full controll access rights to it. - Creating an
npm
directory underC:\Users\teamcityuser\AppData\Roaming
- Creating a file
C:\Windows\System32\config\SystemProfile\.npmrc
with the contentsprefix=C:\npm-global
, as well as creating the latter folder - Running
npm cache clean
before running the build - Installing a global
npm
package throughnpm install -g npm
更重要的是我可以尝试得到这个工作?
What more can I try to get this working?
和避免的XY问题,这里是我的实际问题:
And to avoid the XY problem, here's my actual problem:
我有通过这个TeamCity的安装CI设置一个.NET的Web API项目,通过章鱼部署和托管服务器。我也有与code为Web SPA,将消耗一个API回购GitHub的。水疗中心是建立与咕噜构建
,之后,有一切我需要部署 DIST
文件夹中。
I have a .NET Web API project with CI setup through this TeamCity installation, via Octopus Deploy and to the hosting server. I also have a github repo with the code for a web SPA that will consume the API. The spa is built with grunt build
, after which there's a dist
folder with everything I need to deploy.
我想重新使用尽可能的CI架构的推出客户端了。
I'd like to re-use as much as possible of the CI architecture to roll out the client too.
推荐答案
由于路径的可执行文件包含 Syswow64资料
,这是一个X32 Powershell的,因此,它指的是X32系统配置文件路径,它位于 C:\\ WINDOWS \\ SYSWOW64 \\ CONFIG \\ systemprofile
。所以,你需要使用该路径作为你的基地,以实施任何变通办法,比如,创建 C:\\ WINDOWS \\ SYSWOW64 \\ CONFIG \\ systemprofile \\应用程序数据\\漫游\\ NPM
文件夹,而不是普通的 C:\\ WINDOWS \\ system32 \\设置\\ systemprofile \\应用程序数据\\漫游\\ NPM
Given that path to executable contains SysWOW64
, this is an x32 Powershell, therefore, it refers to x32 system profile path, which is located at C:\Windows\sysWOW64\config\systemprofile
. So, you need to use that path as your base in order to implement any workarounds, say, create C:\Windows\sysWOW64\config\systemprofile\AppData\Roaming\npm
folder, and not plain C:\Windows\system32\config\systemprofile\AppData\Roaming\npm
.
这篇关于TeamCity的与NPM - 错误:ENOENT,STAT'C:\\ WINDOWS \\ system32 \\设置\\ systemprofile \\应用程序数据\\漫游\\ NPM“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!