Cake.Npm
Cake.Npm copied to clipboard
Getting output errors without errors
When I am running NpmCi, NpmRunScript, and NpmPack in an Azure DevOps pipeline, I'm logging errors, here I don't have any errors. For example:
##[error]npm info using [email protected]\n
##[error]npm info using [email protected]
##[error]npm info prepare initializing installer
##[error]npm info prepare Done in 0.015s
##[error]npm http fetch GET 200 https:*** 1096ms
##[error]npm http fetch GET 200 https:*** 1127ms
##[error]npm info extractTree Done in 2.044s
##[error]npm info updateJson Done in 0.015s
I can recreate this. Here is a link to my build in pipelines https://deviouscreation.visualstudio.com/stance/_build/results?buildId=188. I can mitigate the issue by making the clog level as silent.
I've seen this, too. However on "manual" runs of npm. It's "documented" on https://npm.community/t/npm-ci-logs-success-to-stderr/2303:
With all due respect, your build system is doing it wrong. stderr is just the name of a pipe, it doesn’t have any semantic meaning such as “an error occurred in this process”. stderr is where well-behaved CLI programs emit their logging, and the exit code of the process is where a build system should check if there was an error or not (by convention, shell processes exit non-zero when an error occurred).
(Whatever one may think of that comment)
I think this was fixed - do you still have that problem?
I still have this problem, which is a bummer. It looks like the change for npm from console.error to console.log was ultimately rejected. The linux users don't care what windows says, Standard Error isn't just for errors. I'm going to try to mitigate this by using StandardErrorAction to parse out notice vs error.
I get this problem when I try to publish to an authenticated feed.