You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was running this step on self-hosted windows runner (same for windows-latest) this action failed wit not recognized command error:
Creating ng build 💪
'node_modules' is not recognized as an internal or external command,
operable program or batch file.
Error: Command failed: node_modules/.bin/ng build --configuration=staging --base-href=/demo/
'node_modules' is not recognized as an internal or external command,
operable program or batch file.
Steps to reproduce
Change in GitHub workflow file os to windows-latests. This PR contains reproduced error => EdgarsGarsneks#2
Root Cause
Issue is in the command that is being generated it is referencing node_modules/.bin/ng which Windows tries to resolve when running in cmd and fails because of forward slash usage. 🤦♂️
(1) C:\demo>node_modules/.bin/ng <=== Current command'node_modules' is not recognized as an internal or external command,
operable program or batch file.
(2) C:\demo>./node_modules/.bin/ng <=== Relative path, same error
'.' is not recognized as an internal or external command,
operable program or batch file.
As this project is not executing any npm step proposal would be to use built-in npx. Which would find and execute appropriate binary in the project path. In result changing commands for build and lint to should solve the problem.
npx ng build --configuration=staging --base-href=/demo/
npx ng lint
Linked PR contains mentioned change and also change to workflow file to include tests on windows and mac runners.
Only thing to mention that in order not have race conditions when uploading to gh-pages branch matrix was configured to run without concurrency which will increase total time. To speed up things seperate branches could be used. But I doubt that it would bring any value there. Let me know if I missed something or if you see any simpler solution 😃 🚀!
The text was updated successfully, but these errors were encountered:
Issue
When I was running this step on self-hosted windows runner (same for
windows-latest
) this action failed wit not recognized command error:Steps to reproduce
Change in GitHub workflow file
os
towindows-latests
. This PR contains reproduced error => EdgarsGarsneks#2Root Cause
Issue is in the command that is being generated it is referencing
node_modules/.bin/ng
which Windows tries to resolve when running in cmd and fails because of forward slash usage. 🤦♂️Solution Proposal
As this project is not executing any
npm
step proposal would be to use built-in npx. Which would find and execute appropriate binary in the project path. In result changing commands for build and lint to should solve the problem.Linked PR contains mentioned change and also change to workflow file to include tests on
windows
andmac
runners.Only thing to mention that in order not have race conditions when uploading to gh-pages branch matrix was configured to run without concurrency which will increase total time. To speed up things seperate branches could be used. But I doubt that it would bring any value there. Let me know if I missed something or if you see any simpler solution 😃 🚀!
The text was updated successfully, but these errors were encountered: