Closed MoondanceZ closed 1 year ago
I doubt it has anything to do with IIS specifically. Run it with ExecuteBufferedAsync()
to capture the stderr and see what the error was.
I create a new project, get a new exception, 😂😂
Failed to start a process with file path 'npm'. Target file or working directory doesn't exist, or the provided credentials are invalid.
this problem may be is a little like this question https://stackoverflow.com/questions/54335270/failed-to-start-npm-when-published-to-iis but it didn't solve my problem
What happens if you run where npm
in the command shell?
it's like this
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
It also cannot run properly in IIS.
Command execution failed because the underlying process (where.exe#564) returned a non-zero exit code (1).
Hmm that's really interesting. Maybe the IIS user has some restrictions? I assume you wouldn't be able to run via the Process
class either, so maybe there's a more general StackOverflow topic somewhere related to this.
It's also possible that the IIS user (which is impersonated for launching services inside it) may have a different environment, where npm
is not on PATH
or somehow not available altogether.
Version
3.6.0
Details
I use it in my .net core api project like this
while dubug, it run well. while publish to IIS, it have not been running correctly.
the error is:
Steps to reproduce
just a simple api project publish to iis