toolsplus / nx-forge

Atlassian Forge plugin for Nx
https://toolsplus.github.io/nx-forge/
MIT License
17 stars 4 forks source link

spawn npx process in a shell to fix ENOENT error #105

Closed vladnega closed 2 months ago

vladnega commented 2 months ago

When running the commands that are supposed to call npx forge deploy/register/etc, the following error is displayed on Windows machines: spawn npx ENOENT.

In order to fix it, spawning the npx process in a shell will fix the issue. See this response on SO for reference.

tbinna commented 2 months ago

Hey @vladnega, thanks for the report and the PR. Happy to publish this to a prerelease version for you to test. Could you update the PR description to match Angular commit conventions, for example:

fix: spawn npx process in a shell to fix ENOENT error

When you clone the repository and run npm install commit hooks are installed that validate the commit message. If the message is too long, you can shorten it by removing the "to fix..." part.

vladnega commented 2 months ago

Hi, @tbinna , thanks for letting me know. I have updated the commit message.

I can see the build is still failing, but it's not clear to me why it's doing this.

tbinna commented 2 months ago

Thanks @vladnega. Apologies, the CI issue is with Github not injecting secrets for changes from forked repositories. I will eventually have to look into improving the contribution workflow. I created #106 with the same changes and released them to beta. Please test them using npm i @toolsplus/nx-forge-4.3.1-beta.1 and let me know if that solves the issue.

Cheers, Tobi

vladnega commented 2 months ago

Thank you @tbinna! This is now working. However, I noticed there is another place where the shell flag should be included: the spawn from the runTunnel function. Could you please include that as well in the beta release?

tbinna commented 2 months ago

Thanks for the heads-up @vladnega. I have updated the tunnel executor with the shell flag. You can test this update with npm i @toolsplus/nx-forge-4.3.1-beta.2. If there are no issues from your end, I am happy to merge this into the main branch.

vladnega commented 2 months ago

Thank you, @tbinna. Yup, that works now for me 👍