2015-07-10 113 views
4

我遇到了严重的问题,我的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中有两台虚拟机,分别为buildagent。两者都连接到相同的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架构来推出客户端。

  • +0

    您是否尝试在系统配置文件下创建'npm'文件夹? 'C:\ Windows \ sysWOW64 \ config \ systemprofile \ AppData \ Roaming \ npm' – Vesper

    回答

    4

    鉴于可执行文件的路径包含SysWOW64,因此它是x32 Powershell,因此它指的是位于C:\Windows\sysWOW64\config\systemprofile的x32系统配置文件路径。因此,您需要使用该路径作为您的基础,才能实施任何解决方法,例如创建C:\Windows\sysWOW64\config\systemprofile\AppData\Roaming\npm文件夹,而不是纯文本C:\Windows\system32\config\systemprofile\AppData\Roaming\npm

    +0

    太棒了!这让我进一步,但不是所有的方式:/构建现在失败'npm ERR! EEXIST,打开'C:\ Windows \ system32 \ config \ systemprofile \ AppData \ Roaming \ npm-cache \ 2d6d37d2 -m-cache-lodash-2-4-2-package-tgz。锁' 将它移开,然后再试一次.'即使我在'system32','sysWOW64'和用户的'AppData'中删除所有'npm-cache'文件夹,它在那里停止,然后开始构建... –

    +0

    我做了一个简短的搜索,可以是另一个bug https://github.com/npm/npm/issues/6309到目前为止,我不能进一步帮助,我没时间了。 – Vesper

    +0

    嗯。升级节点(如该问题中的建议)似乎对此有所帮助。非常感谢! –

    相关问题