1

I'm running a Team City build that runs a command line step in a Docker image (stefanscherer/node-windows:8.11.2-nanoserver). The step is simply this:

npm install

Note that Team City allows you to specify a docker image to run the step in; alternatively, I set the build step to run this instead:

docker version
docker run --rm -w "C:\build" -v "%%CD%%:C:\build" --entrypoint cmd  stefanscherer/node-windows:8.11.2-nanoserver "/c" "npm install"

Regardless of how I run the step, I get an error like this:

[09:24:11]npm info it worked if it ends with ok
[09:24:11]npm info using npm@5.6.0
[09:24:11]npm info using node@v8.11.2
[09:24:11]npm info ok 
[09:24:12]npm info it worked if it ends with ok
[09:24:12]npm info using npm@5.6.0
[09:24:12]npm info using node@v8.11.2
[09:24:13]npm ERR! path C:\ContainerMappedDirectories
[09:24:13]npm ERR! code ENOENT
[09:24:13]npm ERR! errno -4058
[09:24:13]npm ERR! syscall lstat
[09:24:13]npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\ContainerMappedDirectories'
[09:24:13]npm ERR! enoent This is related to npm not being able to find a file.
[09:24:13]npm ERR! enoent 
[09:24:13]
[09:24:13]npm ERR! A complete log of this run can be found in:
[09:24:13]npm ERR!     C:\Users\ContainerAdministrator\AppData\Roaming\npm-cache\_logs\2018-08-14T14_24_13_376Z-debug.log
[09:24:14]Process exited with code -4058
[09:24:14]Process exited with code -4058
[09:24:14]Step Command Line failed

Note the error "ENOENT: no such file or directory, lstat 'C:\ContainerMappedDirectories'". I've come across this post: https://github.com/nodejs/node/issues/8897, however that seems to suggest the issue is related to the version of npm that's running, and that it should be fixed by updating. However, I can run the exact same docker image on my development PC with no issues.

Development PC:

Windows 10 Enterprise, version 1803, build 17134.165
PS C:\Users\schaefke> docker version
Client:
 Version:           18.06.0-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        0ffa825
 Built:             Wed Jul 18 19:05:28 2018
 OS/Arch:           windows/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.0-ce
  API version:      1.38 (minimum version 1.24)
  Go version:       go1.10.3
  Git commit:       0ffa825
  Built:            Wed Jul 18 19:23:19 2018
  OS/Arch:          windows/amd64
  Experimental:     false

Team City build:

Windows Server 2016
Client:
 Version:      18.03.1-ee-2
 API version:  1.37
 Go version:   go1.10.2
 Git commit:   ebbcd7e
 Built:        Tue Jul 10 21:32:32 2018
 OS/Arch:      windows/amd64
 Experimental: false

Server:
 Engine:
  Version:      18.03.1-ee-2
  API version:  1.37 (minimum version 1.24)
  Go version:   go1.10.2
  Git commit:   ebbcd7e
  Built:        Tue Jul 10 21:49:06 2018
  OS/Arch:      windows/amd64
  Experimental: false

Team City:

Version 2017.2.1 build 50732

NPM/Node versions:

npm info using npm@5.6.0
npm info using node@v8.11.2

I do get the same error locally if I uninstall Docker for Windows 18 and install 17. Could this be an Enterprise Edition versus Community Edition issue? I don't believe it is an issue with the docker image I'm using, as it runs just fine on my dev machine, nor do I believe it's an issue with the version of npm that's running in the image for the same reason.

Does anyone know what might be causing the issue I'm seeing (or what component--i.e., the docker image, npm, something with Team City, or docker itself--could be the culprit)?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.