socket npm cannot execute npm installed via mise
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- node.js, typescript
调研方向
从 socket npm 命令的入口开始,使用 mise 生成的 ~/.local/share/mise/installs/node/22.21.1/bin/npm wrapper 复现失败。跟踪 CLI 如何启动请求的可执行文件,然后验证 shell 脚本形式的 npm wrapper 能够被处理,而不会被 Node 当作 JavaScript 解析。该 issue 没有指出任何仓库文件或测试,因此完成时应包含针对此调用的回归检查。
由索引模型根据 Issue 内容生成。
描述
mise puts node and npm file pointing like ~/.local/share/mise/installs/node/22.21.1/bin/npm
which is a shell script :(
#!/usr/bin/env bash
set -euo pipefail
# This script wraps npm so to run `mise reshim` after global installs and uninstalls
# Any other cases are passed-through to npm
this_dir=$(dirname "${BASH_SOURCE[0]}")
plugin_name=$(basename "$(dirname "$this_dir")")
this_dir=$(cd "$this_dir" && pwd -P) # Normalizes the directory
...
So socket npm fails because it isn't a node script.
$ socket npm i
_____ _ _ /---------------
| __|___ ___| |_ ___| |_ | CLI: v1.1.38
|__ | . | _| '_| -_| _| | token: (not set), org: (not set)
|_____|___|___|_,_|___|_|.dev | Command: `socket npm`, cwd: **
/Users/kesoji/.local/share/mise/installs/node/22.21.1/bin/npm:2
set -euo pipefail
^^^^^^^^
SyntaxError: Unexpected identifier 'pipefail'
at wrapSafe (node:internal/modules/cjs/loader:1638:18)
at Module._compile (node:internal/modules/cjs/loader:1680:20)
at Object..js (node:internal/modules/cjs/loader:1839:10)
at Module.load (node:internal/modules/cjs/loader:1441:32)
at Function._load (node:internal/modules/cjs/loader:1263:12)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)
at node:internal/main/run_main_module:36:49
Node.js v22.21.1
Is there any solution or workaround?
- 主要语言
- TypeScript
- 星标
- 317
- 派生
- 65
- 平均合并
- 1 小时 26 分钟
- 30 天内合并 PR
- 30
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SocketDev/socket-cli 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
SocketDev/socket-cli#1160 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
SocketDev/socket-cli#1547 ·
-
难度 5/5 一周以上 新手友好度 35/100
SocketDev/socket-cli#1525 ·
-
难度 3/5 1-2 天 新手友好度 45/100
SocketDev/socket-cli#1517 ·
-
难度 3/5 1-2 天 新手友好度 68/100
SocketDev/socket-cli#1498 ·
查看 SocketDev/socket-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 75/100
fil-donadoni/tolaria#4409 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
corsairdev/corsair#1764 ·