The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
npm install failure in Windows does not set %ERRORLEVEL%
I have a Jenkins build on a Windows server, and currently the “npm install” returns an error. But the Jenkins build step is not marked as failed, because a failed “npm install” does not set ERRORLEVEL.
To reproduce this problem, you need a setup where “npm install” fails. Then create and run a batch file like this:
call npm install echo %ERRORLEVEL% @pause
If npm install fails, and %ERRORLEVEL% is 0, that comfirms the problem.
A failed “npm install” should set %ERRORLEVEL% to a value greater than 0.
$ npm --versions npm: '6.1.0', ares: '1.14.0', cldr: '33.0', http_parser: '2.8.0', icu: '61.1', modules: '64', napi: '3', nghttp2: '1.29.0', node: '10.3.0', openssl: '1.1.0h', tz: '2018c', unicode: '10.0', uv: '1.20.3', v8: '6.6.346.32-node.9', zlib: '1.2.11' $ node -p process.platform win32
This is a feature request in disguise. Moved to #ideas.
I wonder if this is something that should be fixed at the node level, based on exitCode, which we do set.