-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm in Node 6.2.0 MSI does not work in Windows Docker container #7044
Comments
cc @nodejs/docker @StefanScherer I can't help much with docker, but there are some things you could try. First, does If not, I guess investigating permissions may make sense. You can use a tool like AccessEnum or
and compare that with
|
@joaocgreis Thank you, but inside a Windows container all processes are running as containeradmin (something like root in Linux containers). I tested a little more and found out that the problem is not npm, but the node.exe 6 interpreter. I've installed Node.js 6.2.0 MSI inside a Windows container and checked the versions. As described above node.exe works, but npm doesn't work:
Then I also downloaded just the Node.js 4.4.5 Exe file 64bit and copied it over the node.exe 6.2.0. Now both node.exe and npm work:
As you can see with node.exe 4.4.5 I'm able to run npm.cmd in version 3.8.9. So there seems to be a code change that is causing the problem. |
If you download node.exe 6.2.0 and replace, does it work? Just to make sure it's not a problem with the bundled exe. Can you test both 32 and 64 bit? Thanks! |
In the meantime I've added my test FROM windowsservercore
ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 6.2.0
ENV NODE_SHA256 bd1d766e15f75f67befa76738bc0212ee3016444eb0396b29c6fc319658e21a2
RUN powershell -Command \
wget -Uri https://nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%-x64.msi -OutFile node.msi -UseBasicParsing ; \
if ((Get-FileHash node.msi -Algorithm sha256).Hash -ne $env:NODE_SHA256) {exit 1} ; \
Start-Process -FilePath msiexec -ArgumentList /q, /i, node.msi -Wait ; \
Remove-Item -Path node.msi
RUN powershell -command wget -uri https://nodejs.org/dist/v4.4.5/win-x64/node.exe -outfile c:\node4.4.5.exe
RUN powershell -command wget -uri https://nodejs.org/dist/v5.11.1/win-x64/node.exe -outfile c:\node5.11.1.exe
RUN powershell -command wget -uri https://nodejs.org/dist/v6.0.0/win-x64/node.exe -outfile c:\node6.0.0.exe
RUN powershell -command wget -uri https://nodejs.org/dist/v6.1.0/win-x64/node.exe -outfile c:\node6.1.0.exe
CMD [ "node.exe" ]
It seems that beginning with Node 6 the problem occurs. I only test the 64bit version as eg. |
Looks like a regression. Can it run other javascript files? |
Doesn't look like, neither
|
Always the problem with |
Digging deeper inside a container. Overwritten the
Found #6861 which sounds very related |
#6861 fails with |
Tried a similar command
I think both issues are related as Don't know how to help, any advice? Run the unit tests of libuv inside a container? |
Similar to #7192, I suspect this might have to do with reparse point handling (or lack thereof ) on the realpath implementation. |
This reverts parts of nodejs@b488b19 restoring javascript implementation of realpath and realpathSync. Fixes: nodejs#7175 Fixes: nodejs#6861 Fixes: nodejs#7294 Fixes: nodejs#7192 Fixes: nodejs#7044 Fixes: nodejs#6624 Fixes: nodejs#6978
I was having the same error const cares = process.binding('cares_wrap'); I solved the problem. In device manager under network devices, I was having these two devices disabled. When I enabled them, everything is working fine. Please take a look the image below: |
Node.js 6.x has a problem running inside a Windows Docker container. While filling out this template I drilled down that the problem seems to be npm 3.x. You can find the Dockerfiles to build the Windows Docker images with Node at https://github.com/StefanScherer/dockerfiles-windows/tree/master/node
Node 6.2.0:
Running an interactive Windows Docker container with Node.js 6.2.0 shows an error at npm:
But the file is there:
Node 4.4.5:
Running an interactive Windows Docker container with Node.js 4.4.5 works fine.
Also the
onbuild
version works on Windows for Node.js apps with a Dockerfile like this:FROM stefanscherer/node-windows:4-onbuild
and
Or even running inside a nanoserver container eg. on Windows 10 Insider 14352 with Docker installed:
FROM stefanscherer/node-windows:4-nano-onbuild
and
The text was updated successfully, but these errors were encountered: