npm install and test not working on windows (cmd.exe) #25817
-
I am trying GitHub Actions with two different npm projects. Both appear to silently fail to run the tests on Windows, but run as expected on macOS and Ubuntu. The job seems to stop after the npm install. I have tried npm install and npm ci, I have tried adding –loglevel=error in case warnings in the output were the issue, I have tried npm install || exit 0. I do not have a lot of experience with Windows scripting or Actions so suggestions welcome. https://github.com/shadowspawn/forest-arborist/runs/222728758 Note the install runs, but apparently not the subsequent echo or the tests. (The hash warning is from using yaml comment character in the run commands, and can be disregarded.) |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
I tried specifying
and that got me past the install. The npm test failed in an opaque way without expected output, but at least I have a workaround for the first blocker of continuing past the npm install. |
Beta Was this translation helpful? Give feedback.
-
Discovered cmd.exe advice to prefix calls with Success! Well, somewhat. The GitHub Action did run the install and then the tests. But ignored the tests failing. Progress…
|
Beta Was this translation helpful? Give feedback.
-
I have things working properly on Windows after switching away from multiline run command. e.g.
Don’t know if the other problems I hit were bugs or user error, but I am unblocked. |
Beta Was this translation helpful? Give feedback.
-
I am seeing the same issue myself with your resolution being the only I’ve figured out as well. Unfortunately that becomes painful in larger cases with os matrixes. |
Beta Was this translation helpful? Give feedback.
-
Still seeing issues with windows-2016 as well |
Beta Was this translation helpful? Give feedback.
-
just check using git bash whether npm -v is exeuted or not. If npm is working in git bash , then its not path problem…your path reference is ok. go to environment variable-> system vaiable just check ComSpec : %SystemRoot%\system32\cmd.exe is correct or not in many cases if you have a slash in the end it will not work .for example ComSpec : %SystemRoot%\system32\cmd.exe\ in such case remove the slash if it exists at the end. Otherwise check where does your cmd.exe locate and then put that path in ComSpec Usually it resides at c://Windows/System32/cmd.exe I hope it works. -Sudip |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, but I don’t think you understand the context. The commands are running in a GitHub Action in the cloud. The npm install worked, but the following commands did not run. |
Beta Was this translation helpful? Give feedback.
I have things working properly on Windows after switching away from multiline run command. e.g.
Don’t know if the other problems I hit were bugs or user error, but I am unblocked.