-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Windows Server 2019 20201108.1 breaks a build that works in 20201021.0 #2041
Comments
@MarkStega , I guess you are affected by this change: #1953. |
It does not help
The build fails in the same fashion. I have Node 14.15.0 on my local system and the build has no difficulty invoking NPM |
I added trace of executing "node --version" and "npm --version"
So something is keeping the dotnet build from accessing npm in this latest environment |
I really do not understand what is going on. I removed the trace so I was back to the identical workflow file & source as during the failed build. Now the build succeeds. Are the virtual-environments used by github actions somehow cached & possibly incomplete? This is as if the image that was failing somehow did not have npm available but the same numbered image does. Certainly I've shown (and have the logs) that github actions is not 100% reliable. |
@MarkStega , I have looked at your issue and found that issue is related to your changes. Actually, exit code 1 meant that npm fails to install dependency. Your builds started to pass after this commit: simonziegler/Material.Blazor@13e9936 P.S <Exec Command="npm install" ContinueOnError="true" StandardOutputImportance="low" StandardErrorImportance="low" LogStandardErrorAsError="false" IgnoreExitCode="true">
<Output TaskParameter="ExitCode" PropertyName="NpmReturnCode" />
</Exec> Exit code 1 doesn't mean that NPM is not available in environment. If npm is not found, exit code will be 9009. You can easily check it by replacing I suggest improving your code to catch command output in task and print it to logs. In this case, you will see exact error message and it will help debug issue. |
Maxim, Thanks for the help and taking the time to fully unravel the mystery; I made the bad assumption that a non-zero code meant that npm was not present. I'll change my logging to indicate "0 - npm present & successful, 1 - npm probable bad dependencies, 9009 - npm not present"; It is not clear to me why the package-lock.json committed by Simon was wrong and why it got corrected by me checking out his branch and doing builds. It is why I personally hate the trainwreck that is node/npm/js development. |
I probably went overboard, but when it happens to me again 6 months from now I'll not make the same wrong assumption
And it was a manual edit of the package-lock.json that started this whole issue. |
@MarkStega , cool, I am going to close an issue. Please let me know if you have any concerns. P.S. I don't have much experience with msbuild but I guess we can do something like that: <Exec Command="npm install" ConsoleToMsBuild="true" ContinueOnError="true" StandardOutputImportance="low" StandardErrorImportance="low" LogStandardErrorAsError="false" IgnoreExitCode="true">
<Output TaskParameter="ConsoleOutput" PropertyName="NpmOutput" />
<Output TaskParameter="ExitCode" PropertyName="NpmReturnCode" />
</Exec>
<Exec Command="echo ***** 'npm install' return code was $(NpmReturnCode) (0 indicates npm is available)" />
<Exec Command="echo ***** Output: $(NpmOutput)" Condition=" '$(NpmReturnCode)' != '0' " /> It should print command output to build log if exit code != 0 and you will see exact error message in addition to exit code |
Description
A build of a dotnet project fails in 20201108.1
The csproj step that is failing is
My trace log shows
We have two developers collaborating and each has a fork of the repository in question
The developer with the failing run shows a virtual environment of
The developer whose fork build successfully (with all else the same) has
The builds are running as GitHub actions
Area for Triage:
Scripting and command line
Question, Bug, or Feature?:
Bug
Virtual environments affected
Expected behavior
I expect the 1108.1 build to succeed as the 1021.1 build does.
Actual behavior
npm fails to run in the newer environment.
Repro steps
The text was updated successfully, but these errors were encountered: