Repository navigation
Replies: 2 comments 1 reply
|
As a follow up, this does not appear to isolate the tool from the environment. Set the global node to 18, and try and run pi (pi requires node 22.19.0). This error shows that pi is trying to use node 18. This is even the case if we have Now switch into a directory that has a So it seems that this approach does not isolate tools/applications that rely on a runtime such as Node or Python from the surrounding environment. |
|
Short answer: there isn't a When npm installs a CLI, the executable it puts on PATH is a script whose shebang is That's also usually the behavior you want. Plenty of npm CLIs are project tooling — a formatter, a linter, a process manager like foreman — and those should run on the project's node, not on a version frozen when the tool was installed. On your attempts:
What works today is a small wrapper in #!/bin/sh
exec mise exec node@26 'npm:@earendil-works/pi-coding-agent@0.86.1' -- pi "$@"That resolves independently of whatever Worth knowing about the tradeoff: the pin applies to everything Setting a global node avoids that, but as you found in your follow-up, a project's AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: 2.1.236. |
Uh oh!
There was an error while loading. Please reload this page.
I wanted to install a standalone application using npm (specifically
@earendil-works/pi-coding-agent) that depends on Node. I was trying to find an equivalent to other applications such asuv tool installfor Python.Because some of the projects I work on use Node (with
.node-version) I do not have a global Node version configured so that I cannot accidentally run the wrong version of Node with the project.What I was looking for, and feel should be simple, is installing a standalone (isolated) tool/application that relies on an engine such as Python or Node. My hope was that mise could manage the engine versions (similar to
uv), so that if I had multiple tools that use the same engine I only need to install that engine once. Because the tool is standalone (isolated) it should not matter what the global or project specific version of Node is. The tool should use the version of Node that the tool is pinned to.I was after a similar simplicity that you get from applications wrote in go or rust, where I would normally just drop a single binary into
~/.local/binand not have to worry or care about the runtime.Before installing pi I first ran:
Attempts
Attempt 1 (did not pin node version)
Config
The error with this one is understandable, there's no node version selected.
Attempt 2 (still does not pin node version)
Config
This one feels like it should not error. Instead it should just use the latest available (installed) Node version. Though I expected
--pinto pin the Node version, not just the tool version.Attempt 3
Config
This one does pin both the tool version and Node version. Even so it still fails to actually run the command, which seems odd since it's pinned to a specific Node version so the global Node version shouldn't matter.
Error
In all the cases when I try and run the application I just get the error:
Summary
Overall trying to install a standalone tool pinned to a specific Node version feels more complex than it should be. While I can set a global Node version that could run into issue if I have different tools that require different version of Node (this is something I encounter more often with Python).
All reactions