gpt4 book ai didi

node.js - docker Node 窗口 : cryptic error "error during CreateProcess: failure in a Windows system call" file not found

转载 作者:搜寻专家 更新时间:2023-10-31 23:57:13 32 4
gpt4 key购买 nike

在 windows server 2016 上,安装了 docker,并尝试使用 nodejs 运行 docker 镜像。

docker 运行 stefanscherer/node-windows "node -v"

使用以下“消息”抛出错误:

docker: Error response from daemon: container 47c736ce10987311aee01695f735bcfda52222b9effe856c44fd492685249438 encountered an error during CreateProcess: failure in a Windows system call: Le fichier spécifié est introuvable. (0x2) extra info: {"CommandLine":"\"node -v\"","WorkingDirectory":"C:\","Environment":{"NPM_CONFIG_LOGLEVEL":"info"},"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateStdErrPipe":true,"ConsoleSize":[0,0]}.

一些测试

最奇怪的是,有些命令因完全相同的错误而失败,但有些命令却有效。例如:

docker run stefanscherer/node-windows "主机名"=> ecbf0a7a7979

docker 运行 stefanscherer/node-windows "dir"=> 上面有同样的错误(在 CreateProcess 期间遇到错误)

docker 运行 stefanscherer/node-windows "pwd"=>

(结果看起来是一个空字符串)

更多测试

docker run -it stefanscherer/node-windows "cmd"

Microsoft Windows [Version 10.0.14393]                         
(c) 2016 Microsoft Corporation. All rights reserved.

C:\>node -v
v10.9.0

C:\>npm -v
npm info it worked if it ends with ok
npm info using npm@6.2.0
npm info using node@v10.9.0
npm timing npm Completed in 353ms
npm info ok
6.2.0

所以我在 docker Node 镜像中有一个 shell ...并获取 Node 版本和所有版本,没有错误。

我的版本

windows:`Server 2016 标准评估 1607 Build14393.rs1_release.161220-1747``

docker :

λ docker -v
Docker version 18.06.1-ce, build e68fc7a

λ docker version
Client:
Version: 18.06.1-ce
API version: 1.38
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:21:34 2018
OS/Arch: windows/amd64
Experimental: false

Server:
Engine:
Version: 18.06.1-ce
API version: 1.38 (minimum version 1.24)
Go version: go1.10.3
Git commit: e68fc7a
Built: Tue Aug 21 17:36:40 2018
OS/Arch: windows/amd64
Experimental: false

最佳答案

只需删除引号:

docker 运行 stefanscherer/node-windows node -v

这应该有效。 Windows 尝试查找名称为 "node -v" 的可执行文件,否则。

关于node.js - docker Node 窗口 : cryptic error "error during CreateProcess: failure in a Windows system call" file not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52206517/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com