Build Failing on NPM Install - Typings

2019-08-22 10:50发布

问题:

I suddenly have an issue where our build server is now failing on a web build. Our first step after getting sources is to run a PowerShell script that does a few things, including running npm install (so we do not keep all the packages in source control).

The process gets to what should be the last item in the list, and then throws

error EISDIR: illegal operation on a directory, open 'K:\_work\4\s\Web\typings'

No changes have been made to any of the package config files. I have tried several different versions of Node.js, but still get this error. I have also tried installing the typings version we are using (1.3.1) globally on the server, and that does not work either.

The code being run by PowerShell:

Write-Host "START: running npm install"

[string] $pkg_dir = @(Join-Path $Env:BUILD_SOURCESDIRECTORY "\Web") 

&npm --prefix $pkg_dir install $pkg_dir --loglevel "error"

Write-Host "FINISHED: running npm install"

Given this, I have no idea how it would even try to do anything with the offending directory, or where I would put any directory checking code (as mentioned in the comments).