I'm having serious problems getting the last pieces of my TeamCity configuration in place.
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
I've seen that this is a known problem, but none of the solutions has worked for me so far.
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:
domain\teamcityuser
has full controll access rights to it.npm
directory under C:\Users\teamcityuser\AppData\Roaming
C:\Windows\System32\config\SystemProfile\.npmrc
with the contents prefix=C:\npm-global
, as well as creating the latter foldernpm cache clean
before running the buildnpm
package through npm install -g npm
What more can I try to get this working?
And to avoid the XY problem, here's my actual problem:
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.
I'd like to re-use as much as possible of the CI architecture to roll out the client too.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With