-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proto run npm/pnpm/yarn fails with program not found
if bin not in path
#311
Comments
Current workaround in my PowerShell profile: function pnpm { proto run node -- $(proto bin pnpm) @args }
function npm { proto run node -- $(proto bin npm) @args }
function yarn { proto run node -- $(proto bin yarn) @args } Also needed this for powershell-based app kickers installed by function node.exe { proto run node -- @args } |
@rotu Ah damn. This is a troublesome one. In the last PR (#308), I made the change that tools that require a parent (mainly npm/pnpm/yarn) will be executed with the parent This change was made because otherwise, we have nested shim executions, which cause problems with CTRL+C and signals on Windows. For example, this is a standard flow.
As you can see, it kind of just keeps going all the way down. The intermediate shims are problematic, so I updated it to skip the shims. I'm open to feedback on this. Windows shims seem to be causing a bunch of problems and I'm not 100% sure what the ideal path forward is now. Some ideas:
|
Is nested shim execution still a problem now that "Terminate batch job?" doesn't show up? What's wrong with calling I thought the "terminate batch job?" was the main shim issue. Admittedly I don't understand the endlocal & goto #_undefined_# 2>NUL || title %COMSPEC% & proto.exe run node -- %* I think adding
Here are my thoughts:
|
Yeah it was still a problem in my testing.
The problem was 2 things: 1) hitting ctrl+c either wouldn't work, or you had to spam it constantly for the process to exit. for the most part, you had to open a new terminal window. 2) when it did exit with ctrl+c, the terminal history is lost for some reason. Also required a new terminal window.
Had another idea. Maybe we resolve it to
Agreed. I've been looking into creating the .exe at runtime, but it seems kind of... impossible. But I know its not. Maybe need another kind of portal executable.
The .ps1 files actually work great. The problem is the .cmd files. And the other problem is that .ps1 is not in We could modify |
Testing here, this may work: #313 |
That does sound crummy. I found an explanation of the hack: microsoft/terminal#217 It creates a fatal error ( I recommend taking another look at this alternate solution. It does seem to play nice with
Yeah! I think that's a very reasonable solution.
But the
You need to ensure |
Just had a thought, thanks to this comment:
Maybe, just maybe, we can provide 2 executables: |
Now we're on the same page! I said one executable, but I don't have a strong feeling about one or two. This might be able to fully replace the current shims, but there's some references to platform-specific behavior, so I'm not sure where it wouldn't work (or if we even care about those platforms):
|
Yeah I'll do some testing and see what's feasible. I was thinking a secondary shim just so it's super lightweight. As for this issue, can you try 0.23.6 and see if that works? |
Testing some stuff here. #315 If there's certain flows you think I should test (besides signals), let me know. |
I'll give it a shot when I'm back on my Windows compy, probably tomorrow.
A couple things:
|
Good news, both unix/windows resolves the arg name correctly. Also got ctrl+c working super easily. https://github.com/moonrepo/proto/blob/0.24-shim/crates/cli-shim/README.md I'll test piping/redirects etc too, but this seems like a good win. The file size is also 400kb. |
It works! Only two minor issues:
New-Item -Path $env:PROTO_HOME\shims\proto.exe -ItemType SymbolicLink -Value $env:PROTO_HOME\bin\proto.exe
|
Was going to land this change in the next moon version, but I can probably land it sooner: https://github.com/moonrepo/moon/pull/1208/files#diff-8804ae5ea9955fa400fa6ff23b4e911bb4fc5451e09244b0beec7aac21286222R25 Can update upgrade to use that as well. |
I don't have a strong feeling about this but I'm excited that moon is making progress! Admittedly, I still don't understand moon and I don't use it in any meaningful way! I work on a npm-based monorepo project under Mercurial source control. I can put proto through its paces, but not (yet) moon. |
It was mainly about adding the I'm going to close this. Let's keep the shim convo in that new PR. |
What version?
0.23.5
Which command?
No response
What happened?
My path includes
~/.proto/shims
but NOT~/.proto/bin
per here.node_depman_plugin version 0.5.3
node_plugin version 0.5.3
Trace logs?
Operating system?
Windows
Architecture?
x64
The text was updated successfully, but these errors were encountered: